mirror of
https://github.com/wassname/ray.git
synced 2026-07-04 07:35:11 +08:00
Change os.uname()[1] and socket.gethostname() to the portable and faster platform.node_ip() (#8839)
Co-authored-by: Mehrdad <noreply@github.com>
This commit is contained in:
@@ -6,7 +6,7 @@ import traceback
|
||||
import time
|
||||
import datetime
|
||||
import grpc
|
||||
import socket
|
||||
import platform
|
||||
import subprocess
|
||||
import sys
|
||||
from concurrent import futures
|
||||
@@ -92,7 +92,7 @@ class Reporter:
|
||||
"""Initialize the reporter object."""
|
||||
self.cpu_counts = (psutil.cpu_count(), psutil.cpu_count(logical=False))
|
||||
self.ip = ray.services.get_node_ip_address()
|
||||
self.hostname = socket.gethostname()
|
||||
self.hostname = platform.node()
|
||||
|
||||
_ = psutil.cpu_percent() # For initialization
|
||||
|
||||
@@ -252,7 +252,7 @@ if __name__ == "__main__":
|
||||
args.redis_address, password=args.redis_password)
|
||||
traceback_str = ray.utils.format_error_message(traceback.format_exc())
|
||||
message = ("The reporter on node {} failed with the following "
|
||||
"error:\n{}".format(socket.gethostname(), traceback_str))
|
||||
"error:\n{}".format(platform.node(), traceback_str))
|
||||
ray.utils.push_error_to_driver_through_redis(
|
||||
redis_client, ray_constants.REPORTER_DIED_ERROR, message)
|
||||
raise e
|
||||
|
||||
Reference in New Issue
Block a user