Details
Description
Building the network module from the latest source using "maven m:fresh-checkout m:rebuild-all":
[junit] [ERROR] TEST org.apache.geronimo.network.protocol.control.ControlProtocolTest FAILED
The test gets a CancelledKeyException in the addInterestOps function of SelectorManager.
It is near the end of the test and ProtocolFactory.drain has been called.
The ControlServerProtocol.drain function is sending a ShutdownRequestDownPacket down the stack.
At the very end of SocketProtocol.sendDown, addInterestOps is called.
Perhaps addInterestOps should test for a cancelled SelectionKey by calling selectorKey.isValid() before calling selectorKey.interestOps.
The key may have been cancelled by closing the channel or closing the selector.
Testcase: test(org.apache.geronimo.network.protocol.control.ControlProtocolTest): Caused an ERROR
null
java.nio.channels.CancelledKeyException
at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionKeyImpl.java:55)
at sun.nio.ch.SelectionKeyImpl.interestOps(SelectionKeyImpl.java:59)
at org.apache.geronimo.network.SelectorManager.addInterestOps(SelectorManager.java:238)
at org.apache.geronimo.network.protocol.SocketProtocol.sendDown(SocketProtocol.java:268)
at org.apache.geronimo.network.protocol.control.ControlServerProtocol.drain(ControlServerProtocol.java:112)
at org.apache.geronimo.network.protocol.AcceptableProtocolStack.drain(AcceptableProtocolStack.java:114)
at org.apache.geronimo.network.protocol.ProtocolFactory.drain(ProtocolFactory.java:141)
at org.apache.geronimo.network.protocol.control.ControlProtocolTest.test(ControlProtocolTest.java:150)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)