Обсуждение: DBD-pg - server closed the connection unexpectedly
OpenBSD 4.1-beta; pg 8.2.3; p5-DBI-1.53; p5-DBD-Pg-1.47 Here is a portion of my script. The system() call executes successfully once, then script crashes. Any ideas why this would happen. This script has run without issue on platform where all above software was older versions. my $val='A B C'; my $sql="UPDATE suit_query SET head=?,neck=? WHERE username=? AND qry=?"; $sth=$dbc->prepare($sql); foreach my $h (split(' ',$val)) { foreach my $n (split(' ',$val)) { $sth->execute( "$h%","$n%", $usr, $qry ); $cmd="(date;nice -15 ./suits.pl $dbx $dbn $usr $qry;date)"; print( "$cmd > txt/$usr.$qry$h$n\n"); system( "$cmd > txt/$usr.$qry$h$n" ); } } $dbc->disconnect(); Output from script: (date;nice -15 ./suits.pl RL fbax Combined 200;date) > txt/Combined.200AA DBD::Pg::st execute failed: server closed the connection unexpectedlyThis probably means the server terminated abnormallybeforeor while processing the request. DBD::Pg::st execute failed: server closed the connection unexpectedlyThis probably means the server terminated abnormallybeforeor while processing the request. /suits.pl is a long running script and also accesses pg database through DBD-pg... $ grep 2007 txt/Combined.200AA Fri Mar 2 14:10:04 EST 2007 Sat Mar 3 02:29:34 EST 2007
Frank Bax <fbax@sympatico.ca> writes: > Here is a portion of my script. The system() call executes successfully > once, then script crashes. Any ideas why this would happen. What shows up in the postmaster log? Can you get a stack trace from the (presumably) crashing backend? regards, tom lane
-----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160 > Here is a portion of my script. The system() call executes successfully > once, then script crashes. Any ideas why this would happen. This script > has run without issue on platform where all above software was older versions. ... > /suits.pl is a long running script and also accesses pg database through > DBD-pg... There are really too many unknowns to say for sure. If you can narrow it down to a simple reproducible test case, that would help a lot. Please also try the latest DBD::Pg (1.49) and see if that clears up the problem. - -- Greg Sabino Mullane greg@turnstep.com PGP Key: 0x14964AC8 200703081051 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -----BEGIN PGP SIGNATURE----- iD8DBQFF8DD9vJuQZxSWSsgRA3EZAJkBrgMPumNREzYsQ9NkLu8k2Z6CzQCfT8Uh 3XKNN55q3pIgXLZH5v6p6q0= =qhAm -----END PGP SIGNATURE-----
At 03:20 PM 3/7/07, Tom Lane wrote: >Frank Bax <fbax@sympatico.ca> writes: > > Here is a portion of my script. The system() call executes successfully > > once, then script crashes. Any ideas why this would happen. > >What shows up in the postmaster log? Can you get a stack trace from the >(presumably) crashing backend? Backend is not crashing. When I looked at log on this busy system, I found out this version is producing numerous warnings about escape sequences in other scripts. I will attempt to clean that up; so I can isolate messages. I see a few messages about "unexpected EOF on client connection"; but I am not certain that they are from my problem script. I will also try Greg's suggestion about creating a "simple reproducible test case". BTW: is there a way to timestamp the messages in log?
Frank Bax wrote: > BTW: is there a way to timestamp the messages in log? Sure, use %t in log_line_prefix (there is also an escape sequence to get microseconds, but I forget it). -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.
On Fri, 2007-03-09 at 08:44 -0500, Frank Bax wrote: > At 03:20 PM 3/7/07, Tom Lane wrote: > > >Frank Bax <fbax@sympatico.ca> writes: > > > Here is a portion of my script. The system() call executes successfully > > > once, then script crashes. Any ideas why this would happen. > > > >What shows up in the postmaster log? Can you get a stack trace from the > >(presumably) crashing backend? > > > Backend is not crashing. When I looked at log on this busy system, I found > out this version is producing numerous warnings about escape sequences in > other scripts. I will attempt to clean that up; so I can isolate > messages. I see a few messages about "unexpected EOF on client > connection"; but I am not certain that they are from my problem script. I had a problem with similar symptoms on FreeBSD where a kernel bug caused a protocol violation. I am using SSL, and messages like "Host is down" appeared in the server logs. I'm not sure what exactly happens when not using SSL. The problem is described here: http://www.freebsd.org/cgi/query-pr.cgi?pr=100172 Thanks to AndrewSN for tracking it down originally. However, you need to post more information to determine the real cause. Regards,Jeff Davis