Skip to content

Commit 86fb74e

Browse files
author
zhaochun
committed
Fix SHOW BACKENDS return ERROR
In some case, errMsg in Backend maybe null. we change it when check it nut null Issue: apache#317
1 parent 9b8721e commit 86fb74e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎fe/src/main/java/org/apache/doris/system/Backend.java‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,11 @@ public void setBad(EventBus eventBus, String errMsg) {
212212
}
213213

214214
eventBus.post(new BackendEvent(BackendEventType.BACKEND_DOWN, "missing heartbeat", Long.valueOf(id)));
215-
heartbeatErrMsg = errMsg;
215+
// In some case, errMsg is null when catched Exception have no message, which can make
216+
// `SHOW BACKENDS` return ERROR. We check errMsg here to avoid.
217+
if (errMsg != null) {
218+
heartbeatErrMsg = errMsg;
219+
}
216220
}
217221

218222
public void setBackendState(BackendState state) {

0 commit comments

Comments
 (0)