From: | Andreas Pflug <pgadmin(at)pse-consulting(dot)de> |
---|---|
To: | Dave Page <dpage(at)vale-housing(dot)co(dot)uk> |
Cc: | pgadmin-hackers(at)postgresql(dot)org |
Subject: | Re: RFC: pgAgent Scheduler Design |
Date: | 2005-03-11 19:29:56 |
Message-ID: | 4231F1B4.2030803@pse-consulting.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgadmin-hackers |
Dave Page wrote:
>
>
>
>>-----Original Message-----
>>From: Andreas Pflug [mailto:pgadmin(at)pse-consulting(dot)de]
>>Sent: 08 March 2005 18:28
>>To: Dave Page
>>Cc: pgadmin-hackers(at)postgresql(dot)org
>>Subject: Re: [pgadmin-hackers] RFC: pgAgent Scheduler Design
>>
>>Dave Page wrote:
>>
>>
>>>>obs (shell jobs) need a system qualifier.
>>>>
>>>>
>>>
>>>Well that would tie in with the multi-thread model, and the
>>
>>current code
>>
>
>
> Which isn't done in the same transaction as the original select, thus
> allowing a window in which another agent might grab the same job and
> execute it (though from my reading of the code, the second instance
> won't bother to log it's start time, and will probably mess up the
> logging of step results because prtid will be an empty string). Unless
> I'm missing something of course...
You do.
int rc=serviceConn->ExecuteVoid(
"UPDATE ... SET jobagentpid=pg_backend_pid() ...
WHERE jobagentid IS NULL ...");
if (rc == 1) // i.e. if exactly one row was affected, it's our job now.
Regards,
Andreas
From | Date | Subject | |
---|---|---|---|
Next Message | Dave Page | 2005-03-11 20:34:07 | Re: RFC: pgAgent Scheduler Design |
Previous Message | cvs | 2005-03-11 16:34:45 | CVS Commit by dpage: Number weekdays correctly. |