Skip to content
This repository was archived by the owner on Feb 15, 2022. It is now read-only.

Conversation

@r0senritter
Copy link

@r0senritter r0senritter commented Sep 25, 2019

…severed DBPgPP hangs indefintely

Procedure to reproduce

  • Create a listening socket using nc (netcat)
  • Connect to said port using DBD::PgPP
  • Drop the connection

Fix

I use nc to create a listening socket and use DBD::PgPP to connect to that port during which I cancel the connection with ctrl-c and disconnect from nc (netcat). The tester script hangs and does not exit.

With the patch I am proposing it we get a stack trace when a disconnection occurs and it exits gracefully.

[tsaintvil]$ perl tester.pl
heyhey$VAR1 = sub { "DUMMY" };
DBI connect('dbname=test;host=127.0.0.1;port=543213','',...) failed: Connection to database disconnected
at /lib/perl5/DBD/PgPP.pm line 1045.
at /Redacted.pm line 436.

[tsaintvil@]$ nc -l 543213
(testtsaintvil^C
[tsaintvil@]$

I am open to comments, concerns, and suggestions. (perhaps retry?)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant