Fix SHOW BACKENDS return ERROR (#320)

In some case, errMsg in Backend maybe null. we change it when check it
nut null

Issue: #317
This commit is contained in:
Zhao Chun
2018-11-15 20:14:39 +08:00
committed by GitHub
parent f1b673503e
commit 8ac9492b11

View File

@ -212,7 +212,11 @@ public class Backend implements Writable {
}
eventBus.post(new BackendEvent(BackendEventType.BACKEND_DOWN, "missing heartbeat", Long.valueOf(id)));
heartbeatErrMsg = errMsg;
// In some case, errMsg is null when catched Exception have no message, which can make
// `SHOW BACKENDS` return ERROR. We check errMsg here to avoid.
if (errMsg != null) {
heartbeatErrMsg = errMsg;
}
}
public void setBackendState(BackendState state) {