diff --git a/cmake/Modules/FlatBuffersExternalProject.cmake b/cmake/Modules/FlatBuffersExternalProject.cmake index 508010afc..15be46449 100644 --- a/cmake/Modules/FlatBuffersExternalProject.cmake +++ b/cmake/Modules/FlatBuffersExternalProject.cmake @@ -18,9 +18,9 @@ if(DEFINED ENV{RAY_FLATBUFFERS_HOME} AND EXISTS $ENV{RAY_FLATBUFFERS_HOME}) add_custom_target(flatbuffers_ep) else() - set(flatbuffers_VERSION "1.9.0") + set(flatbuffers_VERSION "1.10.0") set(flatbuffers_URL "https://github.com/google/flatbuffers/archive/v${flatbuffers_VERSION}.tar.gz") - set(flatbuffers_URL_MD5 "8be7513bf960034f6873326d09521a4b") + set(flatbuffers_URL_MD5 "f7d19a3f021d93422b0bc287d7148cd2") set(FLATBUFFERS_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/external/flatbuffers-install") diff --git a/python/ray/experimental/state.py b/python/ray/experimental/state.py index bef88f48c..2048444fb 100644 --- a/python/ray/experimental/state.py +++ b/python/ray/experimental/state.py @@ -366,12 +366,14 @@ class GlobalState(object): node_info[client_id] = { "ClientID": client_id, "IsInsertion": client.IsInsertion(), - "NodeManagerAddress": decode(client.NodeManagerAddress()), + "NodeManagerAddress": decode( + client.NodeManagerAddress(), allow_none=True), "NodeManagerPort": client.NodeManagerPort(), "ObjectManagerPort": client.ObjectManagerPort(), "ObjectStoreSocketName": decode( - client.ObjectStoreSocketName()), - "RayletSocketName": decode(client.RayletSocketName()), + client.ObjectStoreSocketName(), allow_none=True), + "RayletSocketName": decode( + client.RayletSocketName(), allow_none=True), "Resources": resources } return list(node_info.values()) @@ -433,7 +435,8 @@ class GlobalState(object): component_type = decode(profile_table_message.ComponentType()) component_id = binary_to_hex(profile_table_message.ComponentId()) - node_ip_address = decode(profile_table_message.NodeIpAddress()) + node_ip_address = decode( + profile_table_message.NodeIpAddress(), allow_none=True) for j in range(profile_table_message.ProfileEventsLength()): profile_event_message = profile_table_message.ProfileEvents(j) diff --git a/python/ray/utils.py b/python/ray/utils.py index 854393570..cb3c33ecc 100644 --- a/python/ray/utils.py +++ b/python/ray/utils.py @@ -165,10 +165,24 @@ def random_string(): return random_id -def decode(byte_str): - """Make this unicode in Python 3, otherwise leave it as bytes.""" +def decode(byte_str, allow_none=False): + """Make this unicode in Python 3, otherwise leave it as bytes. + + Args: + byte_str: The byte string to decode. + allow_none: If true, then we will allow byte_str to be None in which + case we will return an empty string. TODO(rkn): Remove this flag. + This is only here to simplify upgrading to flatbuffers 1.10.0. + + Returns: + A byte string in Python 2 and a unicode string in Python 3. + """ + if byte_str is None and allow_none: + return "" + if not isinstance(byte_str, bytes): - raise ValueError("The argument must be a bytes object.") + raise ValueError( + "The argument {} must be a bytes object.".format(byte_str)) if sys.version_info >= (3, 0): return byte_str.decode("ascii") else: