public inbox for [email protected]help / color / mirror / Atom feed
pgagent job failing to halt on failed step 3+ messages / 3 participants [nested] [flat]
* pgagent job failing to halt on failed step @ 2015-12-01 05:36 Sanket Mehta <[email protected]> 2015-12-01 09:22 ` Re: pgagent job failing to halt on failed step Dave Page <[email protected]> 0 siblings, 1 reply; 3+ messages in thread From: Sanket Mehta @ 2015-12-01 05:36 UTC (permalink / raw) To: pgadmin-hackers Hi, There is an issue in current pgagent code as explained below: Issue: In batch mode if user creates a job with multiple job steps then if first jobstep gets executed successfully then even if 2nd step is a failure, job will not halt at that point and will complete its execution. which is not the expected result. Analysis: The main reason for this issue is that in batch mode, when first step is executed successfully, flag *succeeded *will be set to true, but when the 2nd step gets failed, its not getting reset to false which is why job does not halt at the same instance and continues executing next steps. I have resolved this issue and patch is attached with this mail for review. Please do review the patch and let me know in case anything is missing. Regards, Sanket Mehta Sr Software engineer Enterprisedb -- Sent via pgadmin-hackers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers Attachments: [text/x-patch] pgagent_job_failing_to_halt.patch (537B, 3-pgagent_job_failing_to_halt.patch) download | inline diff: diff --git a/job.cpp b/job.cpp index f3eaa03..9864f57 100644 --- a/job.cpp +++ b/job.cpp @@ -307,9 +307,7 @@ int Job::Execute() // set success status for batch runs, be pessimistic by default LogMessage(wxString::Format(_("Script return code: %d"), rc), LOG_DEBUG); - if (rc == 0) - succeeded = true; - + succeeded = ((rc == 0) ? true : false); // If output is empty then either script did not return any output // or script threw some error into stderr. // Check script threw some error into stderr ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pgagent job failing to halt on failed step 2015-12-01 05:36 pgagent job failing to halt on failed step Sanket Mehta <[email protected]> @ 2015-12-01 09:22 ` Dave Page <[email protected]> 2015-12-01 10:16 ` Re: pgagent job failing to halt on failed step Ashesh Vashi <[email protected]> 0 siblings, 1 reply; 3+ messages in thread From: Dave Page @ 2015-12-01 09:22 UTC (permalink / raw) To: Sanket Mehta <[email protected]>; +Cc: pgadmin-hackers; Ashesh Vashi <[email protected]> This is what you just committed right Ashesh? On Tue, Dec 1, 2015 at 5:36 AM, Sanket Mehta <[email protected]> wrote: > > Hi, > > There is an issue in current pgagent code as explained below: > > Issue: > In batch mode if user creates a job with multiple job steps then if first > jobstep gets executed successfully then even if 2nd step is a failure, job > will not halt at that point and will complete its execution. which is not > the expected result. > > Analysis: > The main reason for this issue is that in batch mode, when first step is > executed successfully, flag succeeded will be set to true, but when the 2nd > step gets failed, its not getting reset to false which is why job does not > halt at the same instance and continues executing next steps. > > I have resolved this issue and patch is attached with this mail for review. > Please do review the patch and let me know in case anything is missing. > Regards, > Sanket Mehta > Sr Software engineer > Enterprisedb > > > -- > Sent via pgadmin-hackers mailing list ([email protected]) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgadmin-hackers > -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgadmin-hackers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pgagent job failing to halt on failed step 2015-12-01 05:36 pgagent job failing to halt on failed step Sanket Mehta <[email protected]> 2015-12-01 09:22 ` Re: pgagent job failing to halt on failed step Dave Page <[email protected]> @ 2015-12-01 10:16 ` Ashesh Vashi <[email protected]> 0 siblings, 0 replies; 3+ messages in thread From: Ashesh Vashi @ 2015-12-01 10:16 UTC (permalink / raw) To: Dave Page <[email protected]>; +Cc: Sanket Mehta <[email protected]>; pgadmin-hackers Yes. -- Thanks & Regards, Ashesh Vashi EnterpriseDB INDIA: Enterprise PostgreSQL Company <http://www.enterprisedb.com; *http://www.linkedin.com/in/asheshvashi* <http://www.linkedin.com/in/asheshvashi; On Tue, Dec 1, 2015 at 2:52 PM, Dave Page <[email protected]> wrote: > This is what you just committed right Ashesh? > > On Tue, Dec 1, 2015 at 5:36 AM, Sanket Mehta > <[email protected]> wrote: > > > > Hi, > > > > There is an issue in current pgagent code as explained below: > > > > Issue: > > In batch mode if user creates a job with multiple job steps then if first > > jobstep gets executed successfully then even if 2nd step is a failure, > job > > will not halt at that point and will complete its execution. which is not > > the expected result. > > > > Analysis: > > The main reason for this issue is that in batch mode, when first step is > > executed successfully, flag succeeded will be set to true, but when the > 2nd > > step gets failed, its not getting reset to false which is why job does > not > > halt at the same instance and continues executing next steps. > > > > I have resolved this issue and patch is attached with this mail for > review. > > Please do review the patch and let me know in case anything is missing. > > Regards, > > Sanket Mehta > > Sr Software engineer > > Enterprisedb > > > > > > -- > > Sent via pgadmin-hackers mailing list ([email protected]) > > To make changes to your subscription: > > http://www.postgresql.org/mailpref/pgadmin-hackers > > > > > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2015-12-01 10:16 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2015-12-01 05:36 pgagent job failing to halt on failed step Sanket Mehta <[email protected]> 2015-12-01 09:22 ` Dave Page <[email protected]> 2015-12-01 10:16 ` Ashesh Vashi <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox