Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request enhances error reporting and subscription diagnostics. In Python, OwnerDiedError now includes the owner's worker ID, node ID, and address. In C++, the pubsub subscriber now tracks and logs the timestamp of the last published message for each subscription, which is included in debug strings and during GCS failover events. The review feedback highlights two main improvements: first, a potential segmentation fault should be avoided by adding a null check when looking up the channel type descriptor name; second, the age calculation for the last notification should guard against negative values caused by backward system clock shifts.
3f358ff to
973a002
Compare
…ch OwnerDiedError diagnostics Signed-off-by: Prince Kumar <[email protected]>
973a002 to
df1268d
Compare
Signed-off-by: Prince Kumar <[email protected]>
5de9b57 to
e3b4bf1
Compare
Signed-off-by: Prince Kumar <[email protected]>
d7de93c to
3e1f695
Compare
|
@prince8273 Thanks for the PR! I'm not sure I fully follow the motivation though. Could you describe a concrete situation you ran into where debugging was hard without this information, and how these additions would have helped? Thanks! |
Sure @Yicheng-Lu-llll! The concrete situation I ran into is a borrowed ObjectRef that fails with OwnerDiedError in a multi-node cluster. |
|
@prince8273 The OwnerDiedError part makes sense to me. I haven't looked at your PR changes yet, but basically you're saying that when you receive an OwnerDiedError, you want to know the object owner's node ID so you can go to that node and figure out why the owner died. Let me know if I'm understanding this correctly. But I don't get the pubsub part, could you explain a bit more? You mentioned knowing whether the "subscription state was fresh, or whether it was already stale before the failure surfaced." How does that help, and what useful information does it give you? |
|
@Yicheng-Lu-llll Yes, that’s exactly right for the For the pubsub part, I should separate the motivation a bit more clearly. This is not meant to explain why the owner died. It is for debugging object-location subscriptions around publisher id changes. For That timestamp helps answer whether the subscriber was actually receiving object-location updates recently. If it had never received a notification, I would look at the subscribe / initial snapshot path. If it had received one recently, the subscription path was probably alive and I would look elsewhere, such as owner death, eviction, or owner-side location state. If the last notification was old around the publisher-id change, then the reconnect/stale-subscription path becomes more suspicious. So the pubsub part is meant as a small debugging breadcrumb for object-location subscription state, not as a direct diagnosis for |
| f"Owner worker ID: {worker_id.hex()}, " | ||
| f"owner node ID: {node_id}, " | ||
| f"owner address: {ip_addr}:{addr.port}." | ||
| ) | ||
| log_loc = ( | ||
| f"`/tmp/ray/session_latest/logs/*{worker_id.hex()}*`" | ||
| f" at IP address {ip_addr}" |
There was a problem hiding this comment.
But looking at the code, it seems like this line already tells you where to find the log. You'd go to that IP address's node and check the log there.
There was a problem hiding this comment.
You're right that the IP is already there for finding the worker log. The node ID is more useful when correlating with Ray/GCS state directly, for example ray list nodes or GCS worker/node records, where you match on node ID rather than IP. Having it in the error avoids an extra lookup from IP to node ID.
I don't quite get why you need to know this. Could you give me a concrete example? |
Say a worker holds a borrowed ObjectRef and eventually gets OwnerDiedError. One question during debugging is whether the object-location subscription was working normally up until the owner died, or whether it had already silently stopped receiving updates before the failure. If the subscriber never received a notification for that object, the problem might be in the initial subscription or snapshot path, not the owner dying. If it received one recently, I’d be less suspicious of the subscription path and would look more at owner death, eviction, or owner-side location state. If the last notification was a long time ago relative to the publisher-id change, the stale subscription path becomes worth investigating. Without the timestamp, the reconnect log just says the publisher id changed and sequence state was reset. You can't tell which of those cases you're in without digging further. The timestamp gives you that at a glance. |
I see, thanks for explaining, You could take a look at how pubsub is implemented. Basically, pubsub will not "silently stop." |
|
Thanks, that makes sense. I misunderstood that part of the pubsub behavior. Given that pubsub keeps the long-polling connection active and handles publisher failures explicitly, I agree the timestamp/staleness tracking is not well motivated by the case I described. I’ll remove the pubsub changes and keep this PR focused on the |
Signed-off-by: Prince Kumar <[email protected]>
|
@Yicheng-Lu-llll |
|
@edoakes |
|
Thank you @edoakes @Yicheng-Lu-llll both @Yicheng-Lu-llll your questions on the pubsub motivation were spot on, and I learned something new about how Ray's pubsub works. Hope to contribute more going forward. |
…3727) This change adds a bit more context around object ownership loss and GCS pub/sub resubscription behavior. Changes are in src/ray/pubsub/subscriber.h, subscriber.cc, subscriber_test.cc, and python/ray/exceptions.py. On the pub/sub side, each subscriber entry now records the last time it processed a published message. When a publisher ID changes, which can happen after GCS failover, the reconnect log now includes per-channel subscription state and how recently each channel saw a notification. This should make it easier to tell whether a subscriber had an active but stale view, had never received a notification, or had no active subscriptions for that publisher. The subscriber test now checks the timestamp behavior directly instead of relying on the debug string format. For OwnerDiedError, the error message now includes the owner worker ID, owner node ID, and owner address when that information is available. If the node ID is missing, it is shown as unknown instead of printing an empty value. This is intended to make ownership-loss and stale-subscription debugging less dependent on manually piecing together ObjectRef IDs and cluster logs. --------- Signed-off-by: Prince Kumar <[email protected]>
…3727) This change adds a bit more context around object ownership loss and GCS pub/sub resubscription behavior. Changes are in src/ray/pubsub/subscriber.h, subscriber.cc, subscriber_test.cc, and python/ray/exceptions.py. On the pub/sub side, each subscriber entry now records the last time it processed a published message. When a publisher ID changes, which can happen after GCS failover, the reconnect log now includes per-channel subscription state and how recently each channel saw a notification. This should make it easier to tell whether a subscriber had an active but stale view, had never received a notification, or had no active subscriptions for that publisher. The subscriber test now checks the timestamp behavior directly instead of relying on the debug string format. For OwnerDiedError, the error message now includes the owner worker ID, owner node ID, and owner address when that information is available. If the node ID is missing, it is shown as unknown instead of printing an empty value. This is intended to make ownership-loss and stale-subscription debugging less dependent on manually piecing together ObjectRef IDs and cluster logs. --------- Signed-off-by: Prince Kumar <[email protected]>
…3727) This change adds a bit more context around object ownership loss and GCS pub/sub resubscription behavior. Changes are in src/ray/pubsub/subscriber.h, subscriber.cc, subscriber_test.cc, and python/ray/exceptions.py. On the pub/sub side, each subscriber entry now records the last time it processed a published message. When a publisher ID changes, which can happen after GCS failover, the reconnect log now includes per-channel subscription state and how recently each channel saw a notification. This should make it easier to tell whether a subscriber had an active but stale view, had never received a notification, or had no active subscriptions for that publisher. The subscriber test now checks the timestamp behavior directly instead of relying on the debug string format. For OwnerDiedError, the error message now includes the owner worker ID, owner node ID, and owner address when that information is available. If the node ID is missing, it is shown as unknown instead of printing an empty value. This is intended to make ownership-loss and stale-subscription debugging less dependent on manually piecing together ObjectRef IDs and cluster logs. --------- Signed-off-by: Prince Kumar <[email protected]> Signed-off-by: 400Ping <[email protected]>
This change adds a bit more context around object ownership loss and GCS pub/sub resubscription behavior.
Changes are in src/ray/pubsub/subscriber.h, subscriber.cc, subscriber_test.cc, and python/ray/exceptions.py.
On the pub/sub side, each subscriber entry now records the last time it processed a published message. When a publisher ID changes, which can happen after GCS failover, the reconnect log now includes per-channel subscription state and how recently each channel saw a notification. This should make it easier to tell whether a subscriber had an active but stale view, had never received a notification, or had no active subscriptions for that publisher.
The subscriber test now checks the timestamp behavior directly instead of relying on the debug string format.
For OwnerDiedError, the error message now includes the owner worker ID, owner node ID, and owner address when that information is available. If the node ID is missing, it is shown as unknown instead of printing an empty value.
This is intended to make ownership-loss and stale-subscription debugging less dependent on manually piecing together ObjectRef IDs and cluster logs.