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

Invalid input ConnectionInputs.RECV_HEADERS in state ConnectionState.CLOSED #37

Open
dimaqq opened this issue Oct 19, 2020 · 1 comment

Comments

@dimaqq
Copy link
Contributor

dimaqq commented Oct 19, 2020

Got this error and traceback in production:

ProtocolError
Invalid input ConnectionInputs.RECV_HEADERS in state ConnectionState.CLOSED

h2/connection.py in process_input at line 228

h2/connection.py in _receive_headers_frame at line 1554

h2/connection.py in _receive_frame at line 1486

h2/connection.py in receive_data at line 1463

aapns/connection.py in background_read at line 300

Current code in question is:

while not self.closed:
data = await self.read_stream.read(2 ** 16)
if not data:
raise ConnectionError("Server closed the connection")
for event in self.protocol.receive_data(data):
logger.debug("APN: %s", event)
stream_id = getattr(event, "stream_id", 0)
error = getattr(event, "error_code", None)
channel = self.channels.get(stream_id)

Also, looks like that prod was not running the newest aapns 🤔

@dimaqq
Copy link
Contributor Author

dimaqq commented Oct 19, 2020

In short, h2 knows that the connection is closed, but aapns background read coro does not?

I can think of two possibilities:

  • connection got closed during reveive_data (as that can receive many packets at once), or
  • background coro read/write/aclose machinery lost the memo

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