SocketChannel leak in TLSChannelStream

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Java Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      There is a race condition in SelectorMonitor and TlsChannelStream:

      • If MongoClient.close() is called, consequently closing the SelectorMonitor while an OP_CONNECT event is still pending, the underlying SocketChannel remains open and is never closed.
      • Similarly, if there are entities in pendingRegistrations, their associated sockets are also not closed.

      This leads to resource leaks (e.g., TCP connections remaining ESTABLISHED after client shutdown). The fix should ensure proper cleanup of pending events and registrations during MongoClient.close().

      This bug is different from JAVA-5895.

            Assignee:
            Slav Babanin
            Reporter:
            Slav Babanin
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: