JDK-6434287 : (se) SelectionKey.isAcceptable() throws CancelledKeyException
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2006-06-06
  • Updated: 2011-02-16
  • Resolved: 2006-06-06
Related Reports
Duplicate :  
Description
A DESCRIPTION OF THE REQUEST :
SelectionKey seems to be cancelled *before* SelectionKey.cancel() is invoked.  Specifically, the following exception is thrown.
 
java.nio.channels.CancelledKeyException
	at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionKeyImpl.java:55)
	at sun.nio.ch.SelectionKeyImpl.readyOps(SelectionKeyImpl.java:69)
	at java.nio.channels.SelectionKey.isAcceptable(SelectionKey.java:342)

This bug is reportedly the same as 5076772, which is fixed in 6.0.  However, this request is for the fix to be applied to earlier releases (see Justification section below).

JUSTIFICATION :
This exception is hosing communication for our servers running at our client sites.  Specifically, the servers cannot accept any more connections once this problem occurs.

Please fix this for 1.4 since our existings clients are running that version of Java and cannot easily upgrade to 5.0.

At minimal, we need the fix for 5.0 since future clients.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Acceptable socket channels are not cancelled unless explicitly closed.
ACTUAL -
CancelledKeyException is thrown.

CUSTOMER SUBMITTED WORKAROUND :
None at the moment.  We have our clients restart our servers.

Comments
EVALUATION This bug appears to be a request to back-port 5076772 to 1.4. At this time we do not have any plan to proactively fix this issue in a 1.4.2 update. If the issue is critical then the submitter should open a support call and escalate the bug. The submitter also asks about fixing the bug in a 5.0 update. Once the fix has baked in mustang we will examine it for a 5.0 update. That work will use the original bugID for the fix.
06-06-2006