Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when message is larger than max #18

Open
standy66 opened this issue Mar 6, 2019 · 0 comments
Open

Crash when message is larger than max #18

standy66 opened this issue Mar 6, 2019 · 0 comments
Assignees
Labels
Milestone

Comments

@standy66
Copy link
Member

standy66 commented Mar 6, 2019

When message is larger than maximum we crash instead of reporting the error to the peer:

[2019-03-06 09:53:54,561 - root - ERROR]:  Got exception in main dispatch loop
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/purerpc/server.py", line 173, in __call__
    async for stream in self.grpc_socket.listen():
  File "/usr/local/lib/python3.6/site-packages/purerpc/grpc_socket.py", line 228, in listen
    async for stream in self._listen():
  File "/usr/local/lib/python3.6/site-packages/purerpc/grpc_socket.py", line 194, in _listen
    events = self._grpc_connection.receive_data(data)
  File "/usr/local/lib/python3.6/site-packages/purerpc/grpclib/connection.py", line 181, in receive_data
    grpc_events.extend(self._data_received(event))
  File "/usr/local/lib/python3.6/site-packages/purerpc/grpclib/connection.py", line 110, in _data_received
    event.flow_controlled_length)
  File "/usr/local/lib/python3.6/site-packages/purerpc/grpclib/buffers.py", line 78, in data_received
    self._process_new_messages()
  File "/usr/local/lib/python3.6/site-packages/purerpc/grpclib/buffers.py", line 116, in _process_new_messages
    result, flow_controlled_length = self._parse_one_message()
  File "/usr/local/lib/python3.6/site-packages/purerpc/grpclib/buffers.py", line 103, in _parse_one_message
    raise MessageTooLargeError("Received message larger than max: "
purerpc.grpclib.exceptions.MessageTooLargeError: Received message larger than max: 4440990 > 4194304
[2019-03-06 09:53:54,563 - curio.kernel - ERROR]:  Task Crash: Task(id=293457, name='ConnectionHandler.request_received', state='TERMINATED')
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/curio/kernel.py", line 736, in _run_coro
    trap = current._send(current.next_value)
  File "/usr/local/lib/python3.6/site-packages/curio/task.py", line 167, in _task_runner
    return await coro
  File "/usr/local/lib/python3.6/site-packages/purerpc/server.py", line 119, in request_received
    await stream.start_response()
  File "/usr/local/lib/python3.6/site-packages/purerpc/grpc_proto.py", line 37, in start_response
    custom_metadata)
  File "/usr/local/lib/python3.6/site-packages/purerpc/grpc_socket.py", line 153, in start_response
    await self._socket.flush()
  File "/usr/local/lib/python3.6/site-packages/purerpc/grpc_socket.py", line 42, in flush
    await self._socket.sendall(data)
  File "/usr/local/lib/python3.6/site-packages/curio/io.py", line 179, in sendall
    nsent = self._socket_send(buffer, flags)
OSError: [Errno 9] Bad file descriptor
@standy66 standy66 added the bug label Mar 6, 2019
@standy66 standy66 added this to the Release 1.0 milestone Mar 6, 2019
@standy66 standy66 self-assigned this Mar 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant