Disconnect client on error

This commit is contained in:
Volodymyr Babak 2020-10-09 15:50:05 +03:00
parent 160fd94666
commit 0a7d8e8640

View File

@ -133,6 +133,11 @@ public class EdgeGrpcClient implements EdgeRpcClient {
@Override
public void onError(Throwable t) {
log.debug("[{}] The rpc session received an error!", edgeKey, t);
try {
EdgeGrpcClient.this.disconnect(true);
} catch (InterruptedException e) {
log.error("[{}] Got interruption during disconnect!", edgeKey, e);
}
onError.accept(new RuntimeException(t));
}