Use tryFailure() to notify registration failure to avoid IllegalStateException

.. which is raised when the registration promise has been failed already due to an internal error in the pipeline.

- Fixes #1319
This commit is contained in:
Trustin Lee 2013-04-30 18:30:17 +09:00
parent 61327b5871
commit 6646db171e

View File

@ -620,7 +620,11 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha
} catch (Throwable t) {
// Close the channel directly to avoid FD leak.
closeForcibly();
promise.setFailure(t);
if (!promise.tryFailure(t)) {
logger.warn(
"Tried to fail the registration promise, but it is complete already. " +
"Swallowing the cause of the registration failure:", t);
}
closeFuture.setClosed();
}
}