Author: fhanik Date: Wed Mar 28 15:23:41 2012 New Revision: 1306410 URL: http://svn.apache.org/viewvc?rev=1306410&view=rev Log: Per http://markmail.org/message/nhfcvvyvvhtzvaxq Since the method that gets interrupted does something like if (Thread.interrupted()) throw new InterruptedException(); The flag is actually cleared by the method itself. If we wish to propagate the interrupt we have to set the flag again
Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java?rev=1306410&r1=1306409&r2=1306410&view=diff ============================================================================== --- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java (original) +++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java Wed Mar 28 15:23:41 2012 @@ -381,7 +381,9 @@ public class ConnectionPool { } } //while } catch (InterruptedException ex) { - if (!getPoolProperties().getPropagateInterruptState()) { + if (getPoolProperties().getPropagateInterruptState()) { + Thread.currentThread().interrupt(); + } else { Thread.interrupted(); } } @@ -628,7 +630,9 @@ public class ConnectionPool { //retrieve an existing connection con = idle.poll(timetowait, TimeUnit.MILLISECONDS); } catch (InterruptedException ex) { - if (!getPoolProperties().getPropagateInterruptState()) { + if (getPoolProperties().getPropagateInterruptState()) { + Thread.currentThread().interrupt(); + } else { Thread.interrupted(); } SQLException sx = new SQLException("Pool wait interrupted."); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org