Skip site navigation (1) Skip section navigation (2)

pgAgent problem - always runs jobs at every poll

From: "Andy Tilley" <andy(dot)tilley(at)bi-basics(dot)com>
To: <pgadmin-support(at)postgresql(dot)org>
Subject: pgAgent problem - always runs jobs at every poll
Date: 2009-02-20 19:28:23
Message-ID: 055f01c99391$65e5a6a0$31b0f3e0$@tilley@bi-basics.com (view raw or flat)
Thread:
Lists: 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

Next:From: Dave PageDate: 2009-02-20 19:33:59
Subject: Re: pgAdmin no Job node
Previous:From: Dave PageDate: 2009-02-20 15:50:28
Subject: Re: pgAdmin no Job node

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group