Sep 23, 2009 3:26 AM
Crash in AbstractComponent after reconnection
-
Like (0)
Tinder's AbstractComponent class crashes if it receives a packet after having being reconnected to the server.
Indeed, the executor is shutdown but reused in processPacket (RejectedExecutionException).
A correction is to test if the executor is shutdown in the start command (current code just tests the null pointer).
if (executor == null || executor.isShutdown()) {
executor = new ThreadPoolExecutor(maxThreadPoolSize,
maxThreadPoolSize, 60L, TimeUnit.SECONDS,
new LinkedBlockingQueue<Runnable>(maxQueueSize));
}
Patch attached.
Thank you for your bugreport. You're quite right, the component should be restartable. I've created a JIRA issue for this:
TINDER-31.
Your patch has been committed, along with a unit test that verifies that a bug like this doesn't get reintroduced. Thanks again!