Repository navigation
[Pubsub] refactor pubsub to support different channel types - #19498
Conversation
| /// Index that stores the mapping of messages <-> subscribers. | ||
| absl::flat_hash_map<rpc::ChannelType, pub_internal::SubscriptionIndex<ObjectID>> | ||
| absl::flat_hash_map<rpc::ChannelType, | ||
| std::unique_ptr<pub_internal::SubscriptionIndexInterface>> |
There was a problem hiding this comment.
Question here, why do we need a base class for this? If it's about the different type of the key, should we use template instead?
There was a problem hiding this comment.
Basically, the approach here is to allow subscription_index_map_ which is absl::flat_hash_map to hold all SubscriptionIndex, no matter the SubscriptionIndex key type. So we have to use an interface to "type erase" the template types. Publisher has member functions that are agnostic to the channel type, e.g. UnregisterSubscriber(). So I don't see a better / simpler approach yet.
It seems possible to turn Publish() and a few other member functions to be templated on channel type, making some sanity checks static. We can come back later for that.
There was a problem hiding this comment.
Chatted with Yi off thread. Converted SubscriptionIndex to be keyed by std::string instead of a templated key type.
There was a problem hiding this comment.
I think this is fine, but would there be any risk some different ID types are conflicting? I assume the probablity is pretty low?
There was a problem hiding this comment.
I think there shouldn't be any higher chance of collision, because no hash map is merged? Only the value type of subscription_index_map_ is changed from templated SubscriptionIndex to SubscriptionIndex with std::string key ID. Within each SubscriptionIndex there shouldn't be higher chance of collision either, since the set of IDs are still the same.
There was a problem hiding this comment.
ah, I see. So there's one index per channel (I forgot about this although I wrote it lol...)
|
cc @ericl |
fishbone
left a comment
There was a problem hiding this comment.
LG. Thanks for some improvement in the code quality.
rkooo567
left a comment
There was a problem hiding this comment.
LGTM. Just one comment.
… outage (#65880) ## Why this change is needed `data.pyg.org`, the PyG wheel index that every ML/data/rllib depset declares via `--find-links`, has been a dangling CNAME since 2026-09-02: it points at `d28mro9bmx3ky3.cloudfront.net`, and that CloudFront distribution returns `NOERROR` with zero answers from 8.8.8.8, 1.1.1.1 and 9.9.9.9. Upstream is tracking it at pyg-team/pyg-lib#719 and has said they are working on it with urgency; as of their last update there is no ETA. uv fails eagerly on an unreadable `--find-links` URL before deciding whether it needs anything from it, so `raydepsets build --all-configs --check` is red on every run regardless of the PR's contents: | Pipeline | Build | Time (UTC) | Result | |---|---|---|---| | postmerge | #19487 | Sep 2 05:05 | passed (last good) | | postmerge | #19498 | Sep 2 15:28 | pyg DNS | | postmerge | #19501 | Sep 2 16:09 | pyg DNS | | postmerge | #19507 | Sep 2 20:06 | pyg DNS | | postmerge | #19511 | Sep 3 00:05 | pyg DNS | | premerge | #72711, #72712 | Sep 2 | pyg DNS | Every run since ~15:30Z Sep 2 has failed. It blocks every `python_dependencies`-tagged PR and paints master red. The `pip-compile dependencies` step is **not** affected and is left alone: pip treats an unreachable find-links as a warning, PyPI's sdist satisfies `torch-scatter==2.1.2`, and since `requirements_compiled.txt` pins without the `+pt29cpu` local version the output is byte-identical. It passed in all six of the builds above where raydepsets failed, so it keeps guarding `requirements_compiled.txt`. ## What changes `soft_fail: true` on the `raydepsets: compile all dependencies` step, with a comment recording why and when to remove it. `soft_fail` rather than removing the step: the job still runs and reports, so it turns green on its own when upstream restores the record, and reviewers can still see lock drift in its output in the meantime. There's precedent for this pattern in `lint.rayci.yml` (`api-param-coverage`). ## What this does not fix - **Image builds.** 32 deplocks carry the find-links line, so any wanda image build that misses cache fails at `pip install` inside the Dockerfile (#72719 lost `docgpubuild-py3.10` and `mlgpubuild-py3.10` this way). Most PRs are unaffected because unchanged inputs reuse the cached image. Nothing CI-side fixes this without hosting the wheels somewhere else, which is a separate change. - **Lock regeneration.** A PR that needs a new deplock still can't produce one until the index is back, since the recompile itself reads the find-links. ## Cost While this is in, a PR that edits a requirements file without regenerating its lock can merge. The pip-compile guard still covers `requirements_compiled.txt`, and the window should be short. ## Revert when `raydepsets: compile all dependencies` is green on a master postmerge build. Track pyg-team/pyg-lib#719. Signed-off-by: elliot-barn <[email protected]>
… outage (ray-project#65880) ## Why this change is needed `data.pyg.org`, the PyG wheel index that every ML/data/rllib depset declares via `--find-links`, has been a dangling CNAME since 2026-09-02: it points at `d28mro9bmx3ky3.cloudfront.net`, and that CloudFront distribution returns `NOERROR` with zero answers from 8.8.8.8, 1.1.1.1 and 9.9.9.9. Upstream is tracking it at pyg-team/pyg-lib#719 and has said they are working on it with urgency; as of their last update there is no ETA. uv fails eagerly on an unreadable `--find-links` URL before deciding whether it needs anything from it, so `raydepsets build --all-configs --check` is red on every run regardless of the PR's contents: | Pipeline | Build | Time (UTC) | Result | |---|---|---|---| | postmerge | ray-project#19487 | Sep 2 05:05 | passed (last good) | | postmerge | ray-project#19498 | Sep 2 15:28 | pyg DNS | | postmerge | ray-project#19501 | Sep 2 16:09 | pyg DNS | | postmerge | ray-project#19507 | Sep 2 20:06 | pyg DNS | | postmerge | ray-project#19511 | Sep 3 00:05 | pyg DNS | | premerge | #72711, #72712 | Sep 2 | pyg DNS | Every run since ~15:30Z Sep 2 has failed. It blocks every `python_dependencies`-tagged PR and paints master red. The `pip-compile dependencies` step is **not** affected and is left alone: pip treats an unreachable find-links as a warning, PyPI's sdist satisfies `torch-scatter==2.1.2`, and since `requirements_compiled.txt` pins without the `+pt29cpu` local version the output is byte-identical. It passed in all six of the builds above where raydepsets failed, so it keeps guarding `requirements_compiled.txt`. ## What changes `soft_fail: true` on the `raydepsets: compile all dependencies` step, with a comment recording why and when to remove it. `soft_fail` rather than removing the step: the job still runs and reports, so it turns green on its own when upstream restores the record, and reviewers can still see lock drift in its output in the meantime. There's precedent for this pattern in `lint.rayci.yml` (`api-param-coverage`). ## What this does not fix - **Image builds.** 32 deplocks carry the find-links line, so any wanda image build that misses cache fails at `pip install` inside the Dockerfile (#72719 lost `docgpubuild-py3.10` and `mlgpubuild-py3.10` this way). Most PRs are unaffected because unchanged inputs reuse the cached image. Nothing CI-side fixes this without hosting the wheels somewhere else, which is a separate change. - **Lock regeneration.** A PR that needs a new deplock still can't produce one until the index is back, since the recompile itself reads the find-links. ## Cost While this is in, a PR that edits a requirements file without regenerating its lock can merge. The pip-compile guard still covers `requirements_compiled.txt`, and the window should be short. ## Revert when `raydepsets: compile all dependencies` is green on a master postmerge build. Track pyg-team/pyg-lib#719. Signed-off-by: elliot-barn <[email protected]>
Why are these changes needed?
Publisher::subscription_index_map_to hold SubscriptionIndex keyed on ActorID in addition to ObjectID.Related issue number
Checks
scripts/format.shto lint the changes in this PR.