users@grizzly.java.net

key invalid in onConnect, under high load

From: Tobias Jansson <tobias.jansson_at_gmail.com>
Date: Wed, 8 Sep 2010 20:23:54 +0200

Hi,

(Beginner on the mailinglist and with Grizzly...)

I'm using Grizzly 1.9.18k, and have an implementation of a HTTP client and server running. When running under high load I run into problems in the onConnect() in my CallbackHandler:

SelectionKey key = ioEvent.attachment().getSelectionKey();
connectorHandler.finishConnect(key);

The key seems to be invalid/cancelled and then the finishConnect fails with an ClosedChannelException.
I've checked and the key and the underlying channel does not seem to be "reused".

Any ideas what I might have done wrong?

/Tobias