I have been getting Getting java.nio.channels.CancelledKeyException
thrown from:
at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionKeyImpl.java:55)
at sun.nio.ch.SelectionKeyImpl.interestOps(SelectionKeyImpl.java:64)
However, I am not calling the java.nio.channels.SelectionKey.cancel()
explicitly at any point.
An important piece of information is that this is happening in my testing environment which runs on EC2 and there is communication going on between multiple machines where I kill processes in the machines which are target for communication abruptly. However, I could not correlate this exception time of appearance to any initiated process termination. Could this happen if the underlying socket is disconnected or there are network connectivity issues?
Thanks