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()) {
|
if (f.isSuccess()) {
|
||||||
listener.onResponse(channel);
|
listener.onResponse(channel);
|
||||||
} else {
|
} else {
|
||||||
Throwable cause = f.cause();
|
final Throwable cause = f.cause();
|
||||||
// If the Throwable is an Error something has gone very wrong and Netty4MessageChannelHandler is
|
Netty4Utils.maybeDie(cause);
|
||||||
// going to cause that to bubble up and kill the process.
|
assert cause instanceof Exception;
|
||||||
if (cause instanceof Exception) {
|
listener.onFailure((Exception) cause);
|
||||||
listener.onFailure((Exception) cause);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue