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

Connection Lost makes infinite blocking #41

Open
holyachon opened this issue May 23, 2023 · 0 comments
Open

Connection Lost makes infinite blocking #41

holyachon opened this issue May 23, 2023 · 0 comments

Comments

@holyachon
Copy link

holyachon commented May 23, 2023

Hello. I got lambda timeout in AWS Lambda environment.

I set max_connections=10, and logs at the end are below.

Closing connection <aioapns.connection.APNsProductionClientProtocol object at 0x7fa80ee74a10>
Connection <aioapns.connection.APNsProductionClientProtocol object at 0x7fa80ee74a10> lost! Error: None
Connection <aioapns.connection.APNsProductionClientProtocol object at 0x7fa80ee74a10> discarded
Connection released (total: 3)
Closing connection <aioapns.connection.APNsProductionClientProtocol object at 0x7fa80c331310>
Connection <aioapns.connection.APNsProductionClientProtocol object at 0x7fa80c331310> lost! Error: None
Connection <aioapns.connection.APNsProductionClientProtocol object at 0x7fa80c331310> discarded
Connection released (total: 2)
Closing connection <aioapns.connection.APNsProductionClientProtocol object at 0x7fa80e2a8510>
Connection <aioapns.connection.APNsProductionClientProtocol object at 0x7fa80e2a8510> lost! Error: None
Connection <aioapns.connection.APNsProductionClientProtocol object at 0x7fa80e2a8510> discarded
Connection released (total: 1)
Closing connection <aioapns.connection.APNsProductionClientProtocol object at 0x7fa80c076750>
Connection <aioapns.connection.APNsProductionClientProtocol object at 0x7fa80c076750> lost! Error: None
Connection <aioapns.connection.APNsProductionClientProtocol object at 0x7fa80c076750> discarded
Connection released (total: 0)

I think when connection is lost, new connection is not created and it blocks infinite.

In my local environment (M1 Macbook), another exception shown but it is just skipped and works well.

Connection <aioapns.connection.APNsProductionClientProtocol object at 0x10dde3048> terminated: code=ErrorCodes.NO_ERROR, additional_data=b'{"reason":"BadDeviceToken"}', last_stream_id=279
Invalid input ConnectionInputs.RECV_RST_STREAM in state ConnectionState.CLOSED
Traceback (most recent call last):
  File ".../lib/python3.7/site-packages/h2/connection.py", line 224, in process_input
    func, target_state = self._transitions[(self.state, input_)]
KeyError: (<ConnectionState.CLOSED: 3>, <ConnectionInputs.RECV_RST_STREAM: 16>)
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/sym/.pyenv/versions/3.7.16/lib/python3.7/asyncio/sslproto.py", line 545, in data_received
    self._app_protocol.data_received(chunk)
  File ".../python3.7/site-packages/aioapns/connection.py", line 82, in data_received
    for event in self.conn.receive_data(data):
  File ".../python3.7/site-packages/h2/connection.py", line 1463, in receive_data
    events.extend(self._receive_frame(frame))
  File ".../python3.7/site-packages/h2/connection.py", line 1486, in _receive_frame
    frames, events = self._frame_dispatch_table[frame.__class__](frame)
  File ".../python3.7/site-packages/h2/connection.py", line 1786, in _receive_rst_stream_frame
    ConnectionInputs.RECV_RST_STREAM
  File ".../python3.7/site-packages/h2/connection.py", line 229, in process_input
    "Invalid input %s in state %s" % (input_, old_state)
h2.exceptions.ProtocolError: Invalid input ConnectionInputs.RECV_RST_STREAM in state ConnectionState.CLOSED

I think python-hyper/h2#1199 issue is related with it.
Do you have any idea about this? Thank you in advance.

@holyachon holyachon changed the title H2 Connection ProtocolError makes infinite loop Connection Lost makes infinite blocking May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant