Closed tkren closed 9 years ago
Thanks for your Pull Request! :smile: This repo on GitHub is just a mirror of our real git repositories though, and can't really handle PRs. :frowning: Hopefully you can redo the PR, and direct it to the git.postgresql.org repos? We have a developer guide, if that helps: https://wiki.postgresql.org/wiki/So,_you_want_to_be_a_developer%3F. If this was a PR for pgAdmin, please visit https://www.pgadmin.org/docs/pgadmin4/dev/submitting_patches.html.
Running pgagent on Debian jessie with an SQL jobstep crashes the worker thread with the error message
Caught unhandled unknown exception; terminating
. Both job and jobstep status then remain asr
(running) until the pgagent process quits. After restarting pgagent, which cleans up the job status and sets it tod
(aborted), the job containing the SQL jobstep is free to run again, but the next run will end up in the same deadlock situation.I have tracked down the problem to
DBconn::GetLastError()
, which gets called after each SQL jobstep execution inJob::Execute()
: there,DBconn::GetLastError()
throws an exception whenever the last error message is empty.This pull request fixes this problem by adding missing bounds checks to
DBconn::GetLastError()
.Here is a log of pgagent with an SQL jobstep: