Re: Issue with pgAgent jobs forever running state after server restart

Поиск
Список
Период
Сортировка
От Bastiaan Olij
Тема Re: Issue with pgAgent jobs forever running state after server restart
Дата
Msg-id 5144FF53.6090605@basenlily.me
обсуждение исходный текст
Ответ на Issue with pgAgent jobs forever running state after server restart  ("Paragon Corporation" <lr@pcorp.us>)
Ответы Re: Issue with pgAgent jobs forever running state after server restart  (Dave Page <dpage@pgadmin.org>)
Список pgadmin-support
Hi Leo,

On 17/03/13 9:37 AM, Paragon Corporation wrote:
> This has been an issue for a while but has only become a more common issue
> for us recently and one we can more easily predict.
>
> We are running pgAgent on windows, and whenever we restart the server, if a
> job is in the middle of a run when we restart, it gets stuck in a forever
> endless running state.
>
> To fix the issue, we have to go into the pgagent.pga_job table and get rid
> of the jobagentid that is in there for the specific job that is stuck.
>
> We are running the pgAgent 3.3.0 that is available via Stack Builder.
>
When the job starts pgAgent simply updates the status to running. When
it finishes it updates the status to either failed or completed.
When you restart in the middle of a job running that job gets
interrupted but as pgAgent also shuts down it is not able to change the
status on the job. When it restarts it has all but forgotten about that
job that was running.

That it still says running doesn't mean there is actually something
still running in this case, pgAgent in that respect is a pretty straight
forward unintelligent application (and I don't mean that in a negative
way). If pgAgent went down for some other reason the process could
indeed still be running and pgAgent has no way of knowing this. Not all
application shut down just because the host application disappears, some
are designed to complete the process if at all possible in the background.

The only way to get around this is indeed to do what you do and reset
the status manually.

I guess pgAgent could be enhanced to change the status to failed of any
job still marked as running when it starts up but if this is happening
often enough for you to worry about it you might want to talk to the
people who decide to restart servers while the server is actively busy
doing stuff like running that all too important backup process. I would
be much more worried about that then pgAgent failing to mark a job as
failed or complete on a restart of the server.

I have seen too many servers getting into serious problems because of
ignorant IT people who think janking out the power cord of a machine is
a perfectly reasonable way to fix windows explorer from having gotten stuck.

Cheers,

Bas



В списке pgadmin-support по дате отправления:

Предыдущее
От: "Paragon Corporation"
Дата:
Сообщение: Issue with pgAgent jobs forever running state after server restart
Следующее
От: Guillaume Lelarge
Дата:
Сообщение: Re: Automating Reports