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

Max inbound stream error logging is incorrect #1278

Open
stephenc-pace opened this issue Mar 10, 2023 · 0 comments
Open

Max inbound stream error logging is incorrect #1278

stephenc-pace opened this issue Mar 10, 2023 · 0 comments

Comments

@stephenc-pace
Copy link

In the _recv_headers_frame code, a check is made on the number if inbound streams. If this is above the limit, then a TooManyStreamsError is raised.

The error text and logged value is incorrect and has likely been copy pasted from the other similar error check.

    def _receive_headers_frame(self, frame):
        """
        Receive a headers frame on the connection.
        """
        # If necessary, check we can open the stream. Also validate that the
        # stream ID is valid.
        if frame.stream_id not in self.streams:
            max_open_streams = self.local_settings.max_concurrent_streams
            if (self.open_inbound_streams + 1) > max_open_streams:
                raise TooManyStreamsError(
                    "Max outbound streams is %d, %d open" %
                    (max_open_streams, self.open_outbound_streams)
                )

This should say "Max inbound streams"
and log (max_open_streams, self.open_inbound_streams)

It would probably also be beneficial to take a local copy of the outbound stream count and use that in the log message as the property accessor has side effects.

raise TooManyStreamsError(

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