Code review request 7132889: Possible race conditions in AbstractSelectableChannel
Shirish Kuncolienkar
shirishk at linux.vnet.ibm.com
Mon Aug 13 19:19:03 PDT 2012
On 8/13/2012 8:53 PM, Alan Bateman wrote:
> On 13/08/2012 14:01, Alan Bateman wrote:
>> On 08/08/2012 13:40, Shirish Kuncolienkar wrote:
>>>
>>> I agree that the specification change is not necessary. The change
>>> in implCloseChannel could be limited to eliminating the possibility
>>> of getting a valid selection key while the channel is being closed.
>>> -Shirish
>>>
>> I think the remaining changes are correct. Can you re-generate the
>> webrev so that we have the final patch and I will sponsor this one?
> On second thoughts, as the regLock is the blockingLock then I don't
> think it can be acquired by implCloseChannel so the change will need
> to limited to register and configure. One thing that would be good to
> do is to run the tests (in test/java/nio/channels) with your changes
> to make sure that there aren't any issues.
>
> -Alan.
>
I see that regLock is not limited to blocking mode. Many places the
keyLock is acquired while the regLock is held. If we do not guard the
implCloseSelectableChannel() and key cancellation within the regLock we
would not be able to avoid a key being added while a channel is closed.
Do you think such a behavior should be documented ?
I will run the channel tests as suggested by you.
-Shirish
More information about the nio-dev
mailing list