MCPcopy
hub / github.com/ray-project/ray / __str__

Method __str__

python/ray/exceptions.py:752–787  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

750 """
751
752 def __str__(self):
753 log_loc = "`/tmp/ray/session_latest/logs`"
754 owner_location = None
755 if self.owner_address:
756 try:
757 addr = Address()
758 addr.ParseFromString(self.owner_address)
759 ip_addr = addr.ip_address
760 worker_id = WorkerID(addr.worker_id)
761 node_id = addr.node_id.hex() if addr.node_id else "unknown"
762 owner_location = (
763 f"Owner worker ID: {worker_id.hex()}, "
764 f"owner node ID: {node_id}, "
765 f"owner address: {ip_addr}:{addr.port}."
766 )
767 log_loc = (
768 f"`/tmp/ray/session_latest/logs/*{worker_id.hex()}*`"
769 f" at IP address {ip_addr}"
770 )
771 except Exception:
772 # Catch all to make sure we always at least print the default
773 # message.
774 pass
775
776 return (
777 self._base_str()
778 + "\n\n"
779 + (
780 "The object's owner has exited. This is the Python "
781 "worker that first created the ObjectRef via `.remote()` or "
782 "`ray.put()`. "
783 f"Check cluster logs ({log_loc}) for more "
784 "information about the Python worker failure."
785 + (f"\n\n{owner_location}" if owner_location else "")
786 )
787 )
788
789
790@PublicAPI

Callers

nothing calls this directly

Calls 3

AddressClass · 0.85
_base_strMethod · 0.80
hexMethod · 0.45

Tested by

no test coverage detected