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

SimplePool.permitAcquired method swallows InterruptedException

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.9.1
    • 2.9.0
    • None
    • None
    • 3.5.2-3.fc17.x86_64/JDK1.7.0_06 (x64)

    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

            jeff.yemin@mongodb.com Jeffrey Yemin
            akrainiouk Alexei Krainiouk
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: