Repository navigation
[core] Assert Pub-Sub channel subscription counts to avoid unexpected increases - #65148
sampan-s-nayak merged 12 commits into
Conversation
…te and add worker-death fan-out regression test Signed-off-by: sampan <[email protected]>
| result << "Publisher:"; | ||
| for (const auto &it : cum_pub_message_count_) { | ||
| auto channel_type = it.first; | ||
| // Iterate the subscription indexes (one per registered channel) rather |
There was a problem hiding this comment.
as we only have around 8 channels ( GCS publisher registers 5 channels (actor, job, node-info, worker-delta, node-liveness) and the observability publisher 3 (error, log, resource-usage). I am hoping this does not get too spammy (and I guess these channels would eventually show up in the logs so logging them before first publish should still be ok.
also knowing subscriber counts would be useful info for debugging
Signed-off-by: sampan <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request adds a new test to assert that pub-sub channel subscriptions remain bounded, and updates the GCS publisher's debug string output to iterate over registered subscription channels rather than cumulative publish counters, ensuring all active channels are reported. The review feedback highlights two important issues: a potential FileNotFoundError in the test if the log file is not yet created when check() is first executed, and a potential null pointer dereference in publisher.cc if FindValueByNumber returns nullptr for an invalid channel type.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 83f312f. Configure here.
- Force distinct worker processes with a SignalActor barrier instead of relying on Ray to spread 12 short tasks over >=4 workers, which failed in CI when only 2 workers were reused. - Harden the GCS log parse: tolerate the log not existing yet and read it as utf-8. - Use rpc::ChannelType_Name in Publisher::DebugString instead of dereferencing the descriptor lookup, which can return nullptr. - Add missing Doxygen @return tags on the new SubscriptionIndex getters. Signed-off-by: sampan <[email protected]>
|
The DebugString and test changes LGTM. Are we going to do another gRPC connection count assertion? |
The keyed number reported per channel counts entity *keys*, not subscribers, so N workers all watching the same key showed up as keys=1 and would have slipped through. Add: - SubscriptionIndex::GetNumKeyedSubscribers() (subscribers_to_key_id_ size), reported per channel, so keyed subscriptions that scale with the number of workers are visible. - A publisher-level long-polling subscriber count. There is one long-poll connection per subscriber process per publisher, multiplexed over every channel and key, so this is the connection count and it is channel-agnostic. The test parses per-publisher blocks now, since the GCS dumps both its own publisher and the observability publisher into one debug block. Also swap the worker barrier from a SignalActor to a shared directory: a worker holding an actor handle subscribes to that actor's key on GCS_ACTOR_CHANNEL and to node liveness, which made those counts scale with num_workers and masked what the test guards. With the actor-free barrier every asserted count is unchanged at num_workers=6 and 12. Signed-off-by: sampan <[email protected]>
Signed-off-by: sampan <[email protected]>
Signed-off-by: sampan <[email protected]>
Co-authored-by: Rueian <[email protected]> Signed-off-by: Rueian <[email protected]>
… increases (ray-project#65148) ## Description Regression test to prevent cases like the one identified in ray-project#63310 where every worker ended up subscribing to worker death notifications from every other worker. we assert the following to be true during ray cluster startup: | channel | connections| | -------- | -------- | | GCS_WORKER_DELTA | O(num_nodes) | | GCS_JOB | O(num_nodes) | | GCS_ACTOR | all actor events <= 1, keyed (actor_id) specific events >= 1 | | GCS_NODE_ADDRESS_AND_LIVENESS| no keyed(node_id) listeners | --------- Signed-off-by: sampan <[email protected]> Signed-off-by: Rueian <[email protected]> Co-authored-by: sampan <[email protected]> Co-authored-by: Rueian <[email protected]>

Description
Regression test to prevent cases like the one identified in #63310 where every worker ended up subscribing to worker death notifications from every other worker.
we assert the following to be true during ray cluster startup: