FULL PRODUCT VERSION :
A DESCRIPTION OF THE PROBLEM :
code inspection of the AbstractSelectableChannel class shows that a timing window exists between the channel close and cancellation of the key. Which can lead to following consequences
1. Selector registered on this channel can select the key while the channel is closed or is being closed
2. A new key can be added to the channel while the it is closed or is being closed
3. configureBlocking() can be invoked while the channel is closed or is being closed
One might be able to construct a testcase using a test-specific subclass of AbstractSelectableChannel, which has a synchronization point in its implementation of implCloseSelectableChannel() so that tests can be performed there. However, it would be quite an involved thing to write with clarity.
REPRODUCIBILITY :
This bug can be reproduced rarely.
A DESCRIPTION OF THE PROBLEM :
code inspection of the AbstractSelectableChannel class shows that a timing window exists between the channel close and cancellation of the key. Which can lead to following consequences
1. Selector registered on this channel can select the key while the channel is closed or is being closed
2. A new key can be added to the channel while the it is closed or is being closed
3. configureBlocking() can be invoked while the channel is closed or is being closed
One might be able to construct a testcase using a test-specific subclass of AbstractSelectableChannel, which has a synchronization point in its implementation of implCloseSelectableChannel() so that tests can be performed there. However, it would be quite an involved thing to write with clarity.
REPRODUCIBILITY :
This bug can be reproduced rarely.
- duplicates
-
JDK-7132889 (se) AbstractSelectableChannel.register and configureBlocking not safe from asynchronous close
-
- Closed
-