diff --git a/ci/travis/install-dependencies.sh b/ci/travis/install-dependencies.sh index 3f56b448c..3bebcb540 100755 --- a/ci/travis/install-dependencies.sh +++ b/ci/travis/install-dependencies.sh @@ -265,7 +265,7 @@ install_dependencies() { # Additional streaming dependencies. if [ "${RAY_CI_STREAMING_PYTHON_AFFECTED}" = 1 ]; then - pip install "msgpack>=0.6.2" + pip install "msgpack>=1.0.0" fi if [ -n "${PYTHON-}" ] || [ -n "${LINT-}" ] || [ "${MAC_WHEELS-}" = 1 ]; then diff --git a/python/ray/includes/serialization.pxi b/python/ray/includes/serialization.pxi index 90a634ac9..daa876b73 100644 --- a/python/ray/includes/serialization.pxi +++ b/python/ray/includes/serialization.pxi @@ -177,7 +177,7 @@ cdef class MessagePackSerializer(object): raise Exception('Unrecognized ext type id: {}'.format(code)) try: gc.disable() # Performance optimization for msgpack. - return msgpack.loads(s, ext_hook=_ext_hook, raw=False) + return msgpack.loads(s, ext_hook=_ext_hook, raw=False, strict_map_key=False) finally: gc.enable() diff --git a/python/setup.py b/python/setup.py index a75b481fa..582316623 100644 --- a/python/setup.py +++ b/python/setup.py @@ -194,7 +194,7 @@ requires = [ "google", "grpcio", "jsonschema", - "msgpack >= 0.6.0, < 1.0.0", + "msgpack >= 0.6.0, < 2.0.0", "numpy >= 1.16", "protobuf >= 3.8.0", "py-spy >= 0.2.0", diff --git a/streaming/python/runtime/gateway_client.py b/streaming/python/runtime/gateway_client.py index 8fa4fac61..493de2cf8 100644 --- a/streaming/python/runtime/gateway_client.py +++ b/streaming/python/runtime/gateway_client.py @@ -69,4 +69,4 @@ def serialize(obj) -> bytes: def deserialize(data: bytes): """Deserialize the binary data serialized by `PythonGateway`""" - return msgpack.unpackb(data, raw=False) + return msgpack.unpackb(data, raw=False, strict_map_key=False) diff --git a/streaming/python/runtime/serialization.py b/streaming/python/runtime/serialization.py index a01bf4e2c..2d038e482 100644 --- a/streaming/python/runtime/serialization.py +++ b/streaming/python/runtime/serialization.py @@ -41,7 +41,7 @@ class CrossLangSerializer(Serializer): return msgpack.packb(fields, use_bin_type=True) def deserialize(self, data): - fields = msgpack.unpackb(data, raw=False) + fields = msgpack.unpackb(data, raw=False, strict_map_key=False) if fields[0] == _RECORD_TYPE_ID: stream, value = fields[1:] record = message.Record(value)