[JAVA-3714] AsynchronousTlsChannelGroup.RegisteredSocket can cause an NPE Created: 29/Apr/20  Updated: 28/Oct/23  Resolved: 19/May/20

Status: Closed
Project: Java Driver
Component/s: Async
Affects Version/s: 3.12.3, 4.0.2
Fix Version/s: 3.12.5, 4.0.4

Type: Bug Priority: Major - P3
Reporter: Ross Lawley Assignee: Ross Lawley
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by JAVA-3733 Failing reactive streams integration ... Closed
Related
Case:

 Description   

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();
        }



 Comments   
Comment by Githook User [ 02/Jun/20 ]

Author:

{'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com', 'username': 'rozza'}

Message: Fix race condition causing an NPE in tlschannel

JAVA-3714
Branch: 4.0.x
https://github.com/mongodb/mongo-java-driver/commit/eb24128b7da43c91f95a038be00f72eefd18a243

Comment by Githook User [ 19/May/20 ]

Author:

{'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com', 'username': 'rozza'}

Message: Fix race condition causing an NPE in tlschannel

JAVA-3714
Branch: 3.12.x
https://github.com/mongodb/mongo-java-driver/commit/868821a6472c354e89e0e8b55f7fbe413f967a11

Comment by Githook User [ 19/May/20 ]

Author:

{'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com', 'username': 'rozza'}

Message: Fix race condition causing an NPE in tlschannel

JAVA-3714
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/31e438fbd4082fee073bf75f9db9fde1c7bbddde

Generated at Thu Feb 08 09:00:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.