Skip to content

CASSNODEJS-14: Multiple Node Status Updates - All but One being Dropped - #471

Open
toptobes wants to merge 1 commit into
apache:trunkfrom
toptobes:fix-status-changes-dropped
Open

CASSNODEJS-14: Multiple Node Status Updates - All but One being Dropped#471
toptobes wants to merge 1 commit into
apache:trunkfrom
toptobes:fix-status-changes-dropped

Conversation

@toptobes

@toptobes toptobes commented Jul 28, 2026

Copy link
Copy Markdown

Updates ControlConnection._nodeStatusChangeTimeout to be a map of hosts => timers instead so that if multiple nodes had status updates at the same time, it wouldn't lead to all but one being dropped/ignored, which should speed up recovery time in such cases now

The node status event handlers may look different in the future under an all-encompassing "events handling overhaul", but this is a pretty simple fix for the time being

@SiyaoIsHiding SiyaoIsHiding left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes make sense me. Would be great if we have tests!

Comment thread lib/control-connection.js
// Waits a couple of seconds before marking it as UP
self._nodeStatusChangeTimeout = setTimeout(() => host.checkIsUp(), newNodeDelay);
self._nodeStatusChangeTimers.set(endPoint, setTimeout(() => {
self._nodeStatusChangeTimers.delete(endPoint);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: do we need this line here?

self._nodeStatusChangeTimers.delete(endPoint);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, technically no? But there's not much point keeping dead timer ids around even if they'll be overwritten anyway, it's mostly a minor memory thing.

@SiyaoIsHiding SiyaoIsHiding changed the title Fix node status recovery timers being dropped CASSNODEJS-14: Multiple Node Status Updates - All but One being Dropped Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants