<div dir="ltr">Hi.<div><br></div><div style>Is there any reason for pgpool to sleep when processing query cancellation?</div><div style>Is it possible to unconfigure this sleep (set it to 0)?</div><div style><br></div><div style>

I see explicit attempt to sleep on processing cancellation request here (strace):</div><div style><div><br></div><div style># received connection from client, recognized it&#39;s cancellation request</div><div>24626      0.070666 accept(5, {sa_family=AF_INET, sin_port=htons(64885), sin_addr=inet_addr(&quot;172.18.10.42&quot;)}, [16]) = 6</div>

<div><div>24626      0.000066 read(6, &quot;\0\0\0\20\4\322\26.\0\0o.z\360\243?&quot;, 1024) = 16</div></div><div style># connecting to postgres and relaying</div><div><div>24626      0.000063 connect(7, {sa_family=AF_INET, sin_port=htons(5432), sin_addr=inet_addr(&quot;172.18.10.230&quot;)}, 16) = 0</div>

</div><div><div>24626      0.000060 write(7, &quot;\0\0\0\20\4\322\26.\0\0o.z\360\243?&quot;, 16) = 16</div></div><div style># closing connection to postgres</div><div><div>24626      0.000186 shutdown(7, 1 /* send */) = 0</div>

</div><div><div>24626      0.000105 close(7)            = 0</div></div><div style># sleeping for 1 sec (!)</div><div><div>24626      0.000061 nanosleep({1, 0}, 0x7fff93d85090) = 0</div><div style># closing connection to client</div>

<div>24626      1.000350 shutdown(6, 1 /* send */) = 0</div><div>24626      0.000290 close(6)            = 0</div></div><div><br></div><div style>It&#39;s a HUGE problem for me, as I&#39;m using pgpool with WebLogic server. WebLogic cancels all cached statements when</div>

<div style>- rolling back (an XA?) transaction</div><div style>- closing the pool</div><div style><br></div><div style>The closure is done on a single thread, so for large pools it takes long minutes to close, and often a shared lock is held (as there is apparently no expectation that cancellation would take a long amount of time) Postgres JDBC driver also doesn&#39;t know better and keeps calling cancelQuery() on the same connection, even if multiple statements are being closed.</div>

<div style><br></div><div style>Thank you,</div><div style>  Pawel.</div><div style><br></div></div></div>