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

AsynchronousTlsChannelGroup.RegisteredSocket can cause an NPE

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.12.5, 4.0.4
    • Affects Version/s: 3.12.3, 4.0.2
    • Component/s: Async
    • Labels:
      None

      Looks to be a race condition where non final values have might not be set and close() is called on the channel group.

              public void close() {
                  doCancelRead(this, null);
                  doCancelWrite(this, null);
                  key.cancel();  // NPE if key == null
                  currentRegistrations.getAndDecrement();
                  /*
                   * Actual de-registration from the selector will happen asynchronously.
                   */
                  selector.wakeup();
              }
      

            Assignee:
            ross@mongodb.com Ross Lawley
            Reporter:
            ross@mongodb.com Ross Lawley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: