Die if write listener fails due to fatal error
This commit performs a maybe die check after a write listener fails.
This commit is contained in:
parent
4f8131026e
commit
f79842be6f
|
@ -320,12 +320,10 @@ public class Netty4Transport extends TcpTransport<Channel> {
|
|||
if (f.isSuccess()) {
|
||||
listener.onResponse(channel);
|
||||
} else {
|
||||
Throwable cause = f.cause();
|
||||
// If the Throwable is an Error something has gone very wrong and Netty4MessageChannelHandler is
|
||||
// going to cause that to bubble up and kill the process.
|
||||
if (cause instanceof Exception) {
|
||||
listener.onFailure((Exception) cause);
|
||||
}
|
||||
final Throwable cause = f.cause();
|
||||
Netty4Utils.maybeDie(cause);
|
||||
assert cause instanceof Exception;
|
||||
listener.onFailure((Exception) cause);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue