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:
parent
61327b5871
commit
6646db171e
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user