Your message dated Sun, 20 Dec 2015 22:50:56 +0000
with message-id <[email protected]>
and subject line Bug#781105: fixed in pgagent 3.4.1-1
has caused the Debian Bug report #781105,
regarding pgagent: SQL jobstep deadlock
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
781105: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=781105
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: pgagent
Version: 3.4.0-3
Severity: important
Tags: patch

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 as 'r' (running)
until the pgagent process quits. After restarting pgagent, which cleans
up the job status and sets it to 'd' (aborted), the job containing the
SQL jobstep is free to run again, but the next run will end up in the
same deadlock situation.

$ pgagent -l 2 -f hostaddr=127.0.0.1 port=5432 dbname=pgdb user=pgdb
[...]
DEBUG: Connection stats: total - 1, free - 0, deleted - 0
DEBUG: Checking for jobs to run
DEBUG: Creating job thread for job 5
DEBUG: Creating DB connection: user=pgdb port=5432 hostaddr=127.0.0.1 
dbname=pgdb
DEBUG: Allocating new connection to database pgdb
DEBUG: Starting job: 5
DEBUG: Sleeping...
DEBUG: Creating DB connection: user=pgdb port=5432 hostaddr=127.0.0.1 
dbname=pgdb dbname=pgdb
DEBUG: Allocating new connection to database pgdb
DEBUG: Executing SQL step 40 (part of job 5)
*** Caught unhandled unknown exception; terminating
DEBUG: Destroying job thread for job 5
DEBUG: Checking for jobs to run
DEBUG: Sleeping...
DEBUG: Clearing inactive connections
DEBUG: Connection stats: total - 3, free - 0, deleted - 0
DEBUG: Checking for jobs to run
DEBUG: Sleeping...
DEBUG: Clearing inactive connections
DEBUG: Connection stats: total - 3, free - 0, deleted - 0
DEBUG: Checking for jobs to run
DEBUG: Sleeping...
[...]

I have tracked down the problem to DBconn::GetLastError(), which gets
called after each SQL jobstep execution in Job::Execute(): there,
DBconn::GetLastError() throws an exception whenever the last error
message is empty.

The supplied patch (also sent as pull request
https://github.com/postgres/pgagent/pull/5 to upstream) fixes this
problem.

-- System Information:
Debian Release: 8.0
  APT prefers testing-updates
  APT policy: (500, 'testing-updates'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages pgagent depends on:
ii  libc6           2.19-15
ii  libgcc1         1:4.9.2-10
ii  libpq5          9.4.1-1
ii  libstdc++6      4.9.2-10
ii  libwxbase3.0-0  3.0.2-1+b1

pgagent recommends no packages.

Versions of packages pgagent suggests:
ii  pgadmin3  1.20.0~beta2-1

-- no debconf information
diff --git a/connection.cpp b/connection.cpp
index b7623e6..3e4e3dc 100644
--- a/connection.cpp
+++ b/connection.cpp
@@ -313,13 +313,15 @@ int DBconn::ExecuteVoid(const wxString &query)
 
 wxString DBconn::GetLastError()
 {
+	size_t len = lastError.length();
+
 	// Return the last error message, minus any trailing line ends
-	if (lastError.substr(lastError.length() - 2, 2) == wxT("\r\n")) // DOS
-		return lastError.substr(0, lastError.length() - 2);
-	else if (lastError.substr(lastError.length() - 1, 1) == wxT("\n")) // Unix
-		return lastError.substr(0, lastError.length() - 1);
-	else if (lastError.substr(lastError.length() - 1, 1) == wxT("\r")) // Mac
-		return lastError.substr(0, lastError.length() - 1);
+	if (len >= 2 && lastError.substr(len - 2, 2) == wxT("\r\n")) // DOS
+		return lastError.substr(0, len - 2);
+	else if (len >= 1 && lastError.substr(len - 1, 1) == wxT("\n")) // Unix
+		return lastError.substr(0, len - 1);
+	else if (len >= 1 && lastError.substr(len - 1, 1) == wxT("\r")) // Mac
+		return lastError.substr(0, len - 1);
 	else
 		return lastError;
 }

--- End Message ---
--- Begin Message ---
Source: pgagent
Source-Version: 3.4.1-1

We believe that the bug you reported is fixed in the latest version of
pgagent, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Christoph Berg <[email protected]> (supplier of updated pgagent package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sun, 20 Dec 2015 09:02:05 +0100
Source: pgagent
Binary: pgagent
Architecture: source
Version: 3.4.1-1
Distribution: unstable
Urgency: medium
Maintainer: Debian PostgreSQL Maintainers 
<[email protected]>
Changed-By: Christoph Berg <[email protected]>
Description:
 pgagent    - job scheduler for PostgreSQL
Closes: 781105
Changes:
 pgagent (3.4.1-1) unstable; urgency=medium
 .
   * New upstream release found on github.
     + Fixes crash on parsing error messages.  (Closes: #781105)
   * Extend watch file with github release url.
Checksums-Sha1:
 4858ad8128a4f67d56ade098089970fc6bbacd04 2024 pgagent_3.4.1-1.dsc
 a486bd1c8328de40e43fa7d5237a3667d2667ad7 44961 pgagent_3.4.1.orig.tar.gz
 6482e9bf7d4d52850019f1ccaf36cc88a9920dfc 6528 pgagent_3.4.1-1.debian.tar.xz
Checksums-Sha256:
 10d63882f8b154ea3d7c31e62e48c7b616e22bc67364d0b6a8e493f26936e5ca 2024 
pgagent_3.4.1-1.dsc
 2b20c411ff6c9c205e64e06d93014f9f69ee2780745848de74be82527824921c 44961 
pgagent_3.4.1.orig.tar.gz
 f2ea3563579dac9a140796cd5973bf66b059ec46ec07b2a94fc712ecc00bd913 6528 
pgagent_3.4.1-1.debian.tar.xz
Files:
 7f07cacb6249e986cecb4d1a889c19f9 2024 database optional pgagent_3.4.1-1.dsc
 5e5bb8a958c92e878b3bfe734c027965 44961 database optional 
pgagent_3.4.1.orig.tar.gz
 d5487d763345056144d2010ea3b02fc5 6528 database optional 
pgagent_3.4.1-1.debian.tar.xz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJWdxzVAAoJEExaa6sS0qeuRHsP/jEWvel7UlTSq2L6whNkEnU+
JjBwW/QW+eZDK+kUGtZagTCGrZdxw/+GPSQTSe60/8svlm/B35S25WiNw910PQrf
0yUiY4YhEn24GXVAfrdFiMqr4EIfBtUqtzQ8Z7IWwJ+4ahd70zozusRkffgrAgGl
U4QZQXa3G3wyDorzFqCTFvnuvr/WyWeunuwN/i0gCYfECqJYQJyF7t91aqowWV2t
mZ6mO234X1hfDWka8trsrg8sv7KIOSCqdlrR4CmP8Cmi+gcsmQtpAuRKlN80HpsS
vDe6a324IQPgZkPtP3ueSKbXMz5YYnIEDNsxIxWnYfQTRyWBRtML/BNCYejPsnSJ
2MHufP2lIQg/7VQA0pNZczHLHWTDF//rR+LFLrCZuLP6K8THGZvdKdkT169l5KZ1
YkiytVLVe5Qmp3HWHz7qkCFl8rhk4fVuUCts/DJO3zzsW6MOh1//r0/r6BQDqWtE
M6KUlbPmSbzn8a9NRNlHul18xjVVVdJKVPpt9CKc2ia7wvgwa4AZJ3eBoNdfj/Rl
qx+BHUpS7/PspZYFe/RmkqpeEAHekqlM6qzTooMnI+o1s8aUMQTTw9RgxdUwYAfC
CHpwUo16BFJ8/44RR7pN9GDeSCkjQJbHdLOZv1sH6DV9TBhk9YfbTeRJ6xlA1b53
hVfbxKKoljUlAf4McY7m
=YTGN
-----END PGP SIGNATURE-----

--- End Message ---
_______________________________________________
Pkg-postgresql-public mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-postgresql-public

Reply via email to