Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-635

SimplePool.permitAcquired method swallows InterruptedException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.9.0
    • Fix Version/s: 2.9.1
    • Component/s: None
    • Labels:
      None
    • Environment:
      3.5.2-3.fc17.x86_64/JDK1.7.0_06 (x64)
    • # Replies:
      6
    • Last comment by Customer:
      false

      Description

      SimplePool.permitAcquired(long) method catches InterruptedException but fails to restore interrupted state of the thread thus effectively suppressing the effect of thread interruption.
      Here is the (abbreviated) code in question (SimplePool.java lines 146-159):

          private boolean permitAcquired(final long waitTime) {
              try {
                  // ......
              } catch (InterruptedException e) {
                  return false;
              }
          }

      Instead it should be:

          private boolean permitAcquired(final long waitTime) {
              try {
                  // ......
              } catch (InterruptedException e) {
                  Thread.currentThread().interrupt();
                  return false;
              }
          }

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                5 years, 11 weeks ago
                Date of 1st Reply: