xorbitsai / xoscar

Python actor framework for heterogeneous computing.
https://xoscar.dev
Apache License 2.0
112 stars 23 forks source link

Inappopriate assert #110

Closed frostyplanet closed 1 week ago

frostyplanet commented 3 weeks ago

I suspect there's scanner to send malformed data to the expose port from internet, may remove this assert and change to warning

2024-11-06 11:01:46,326 asyncio      7 ERROR    Task exception was never retrieved
future: <Task finished name='Task-102' coro=<SocketServer.create.<locals>.handle_connection() done, defined at /usr/local/lib/python3.10/dist-packages/xoscar/backends/communication/socket.py:239> exception=Asser
tionError('Received malformed data, please check Xoscar version on both side.')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/xoscar/backends/communication/socket.py", line 241, in handle_connection
    return await server.on_connected(
  File "/usr/local/lib/python3.10/dist-packages/xoscar/backends/communication/socket.py", line 159, in on_connected
    await self.channel_handler(channel)
  File "/usr/local/lib/python3.10/dist-packages/xoscar/backends/pool.py", line 557, in on_new_channel
    message = await channel.recv()
  File "/usr/local/lib/python3.10/dist-packages/xoscar/backends/communication/socket.py", line 90, in recv
    header = await deserializer.get_header()
  File "/usr/local/lib/python3.10/dist-packages/xoscar/serialization/aio.py", line 138, in get_header
    return cloudpickle.loads(await self._get_obj_header_bytes())
  File "/usr/local/lib/python3.10/dist-packages/xoscar/serialization/aio.py", line 109, in _get_obj_header_bytes
    header_length = get_header_length(header_bytes)
  File "/usr/local/lib/python3.10/dist-packages/xoscar/serialization/aio.py", line 80, in get_header_length
    assert version == DEFAULT_SERIALIZATION_VERSION, MALFORMED_MSG
AssertionError: Received malformed data, please check Xoscar version on both side.