Skip to content
Snippets Groups Projects
Commit b982c0c6 authored by Stephen R. van den Berg's avatar Stephen R. van den Berg
Browse files

pgsql: Drop callbacks on destruct of conxion, force short close.

parent 3863a9e2
No related branches found
No related tags found
No related merge requests found
......@@ -316,7 +316,7 @@ private .pgsql_util.conxion getsocket(void|int nossl) {
.pgsql_util.conxion lcon=getsocket(2);
lcon->add_int32(16)->add_int32(PG_PROTOCOL(1234,5678))
->add_int32(backendpid)->add(cancelsecret)->sendcmd(FLUSHSEND);
lcon=0;
destruct(lcon); // Destruct explicitly to avoid delayed close
#ifdef PG_DEBUGMORE
PD("Closetrace %O\n",backtrace());
#endif
......
......@@ -282,6 +282,10 @@ class conxion {
Thread.MutexKey lock = shortmux->lock();
towrite -= output_to(socket,towrite);
lock = 0;
#ifdef PG_DEBUG
if (!i->fillread)
PD("%d>Delayed close to go %d\n", socket->query_fd(), sizeof(this));
#endif
if (!i->fillread && !sizeof(this))
close();
return 0;
......@@ -364,6 +368,7 @@ outer:
}
protected void destroy() {
PD("%d>Close conxion %d\n", socket ? socket->query_fd() : -1, !!nostash);
if(nostash) {
catch {
while(sizeof(closecallbacks))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment