pgAgent problem - always runs jobs at every poll - Mailing list pgadmin-support

From Andy Tilley
Subject pgAgent problem - always runs jobs at every poll
Date
Msg-id 055f01c99391$65e5a6a0$31b0f3e0$@tilley@bi-basics.com
Whole thread Raw
List pgadmin-support

 

Hi there,

 

I’m having an issue with pgAgent which I’m sure is related to this bug:

 

http://archives.postgresql.org/pgadmin-support/2007-11/msg00098.php

 

I’m on Solaris x86, using pgAdmin 1.8.0 (the latest available build for this OS)

 

When I start pgagent, I get this error though:

 

DEBUG: Database sanity check

DEBUG: Clearing zombies

18:56:08: Error: Cannot get the hostname (error 0: Error 0)

DEBUG: Checking for jobs to run

 

 

I’ve looked through the source, and it’s probably here that it’s failing.

 

int MainRestartLoop(DBconn *serviceConn)

wxString hostname = wxGetFullHostName();

 

Any idea as to why the hostname is not being returned? This is the cause of the problem, I think.

Essentially, the SQL being issued is this:

 

            SELECT J.jobid

              FROM pgagent.pga_job J

             WHERE jobenabled

               AND jobagentid IS NULL

               AND jobnextrun <= now()

               AND jobhostagent = '' OR jobhostagent = ''

             ORDER BY jobnextrun

 

So it ALWAYS returns the jobs, regardless of whether they’re enabled or not. Hence, they run at every single poll!

 

Many thanks

Andy Tilley

 

 

pgadmin-support by date:

Previous
From: Dave Page
Date:
Subject: Re: pgAdmin no Job node
Next
From: Isabella Ghiurea
Date:
Subject: pgadmin3 compilation error