Skip to content

Commit

Permalink
ui: handle latency not defined on network page
Browse files Browse the repository at this point in the history
Previously when a cluster with multiple nodes had a node stopped
and then another node quickly started, the network page would crash.
This was due to the node object holding the latency value being
undefined and the ui trying to read this key when that was undefined.
This occurs when a node is in an `UNAVAILABLE` state.
This patch resolves the issue by being more defensive on the front
end by safely attempting to access latency and if it is undefined,
set the value to 0. The existing code is able to handle this case
afterward and will eventually set the user friendly latency status
to `--`.
Resolves: #59322

Release note (ui change): Fixes a bug where a node in the
`UNAVAILABLE` state will not have latency defined and cause the
network page to crash.
  • Loading branch information
Santamaura committed Mar 23, 2022
1 parent 307d2ac commit 372993d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const renderMultipleHeaders = (
const row: any[] = [];
displayIdentities.forEach(identityB => {
const a = nodesSummary.nodeStatusByID[identityA.nodeID].activity;
const nano = FixLong(a[identityB.nodeID].latency);
const nano = FixLong(a[identityB.nodeID]?.latency || 0);
if (identityA.nodeID === identityB.nodeID) {
row.push({ latency: 0, identityB });
} else if (
Expand Down

0 comments on commit 372993d

Please sign in to comment.