Fix an unexpected IllegalStateException from a selector loop when a user cancels a connection attempt
- Fixes #1986
This commit is contained in:
parent
786fdbd6e0
commit
38f57adb70
@ -237,7 +237,8 @@ public abstract class AbstractNioChannel extends AbstractChannel {
|
|||||||
t = newT;
|
t = newT;
|
||||||
}
|
}
|
||||||
|
|
||||||
connectPromise.setFailure(t);
|
// Use tryFailure() instead of setFailure() to avoid the race against cancel().
|
||||||
|
connectPromise.tryFailure(t);
|
||||||
closeIfClosed();
|
closeIfClosed();
|
||||||
} finally {
|
} finally {
|
||||||
// Check for null as the connectTimeoutFuture is only created if a connectTimeoutMillis > 0 is used
|
// Check for null as the connectTimeoutFuture is only created if a connectTimeoutMillis > 0 is used
|
||||||
|
Loading…
Reference in New Issue
Block a user