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

Channel and connection refactor #35

Merged
merged 40 commits into from
Feb 4, 2021
Merged

Channel and connection refactor #35

merged 40 commits into from
Feb 4, 2021

Conversation

mattbennett
Copy link
Member

A number of changes in this dev branch that ran for longer than intended:

  • Drops support for py34 and py35
  • Adds support for py38 and py39
  • Refactors the client to be more DRYl; DependencyProvider now only differs in how it spawns threads
  • ConnectionManager uses a content manager to clean up on exit:
    • Explicitly closes any open streams
    • Sets the stopped event; fixes a bug where clients could deadlock after connection failures
  • Adds explicit handling for the http2 ConnectionTerminated event
  • Timeout threads now abort when all relevant streams are closed; previously they ran forever (!)
  • Stream.close() is now idempotent -- required because many different codepaths now call it, and they race.
  • introduces the notion of channels:

- use timeout for initial client connection
- use timeout for send/recv on client and server connection sockets
- wait for connections to stop before stopping server channel
 (via new serverconnectionpool)
- use context manager to track connection dead-ness
(we were running the test with a compatible server and the wrong label)
otherwise they try to reconnect as the server is being stopped and
produce a traceback in the logs
generate the error as part of the stream rather than afterwards, so
that close is only called once
@mattbennett mattbennett changed the title Client refactor Channel and connection refactor Feb 4, 2021
@mattbennett mattbennett merged commit d4d13dc into master Feb 4, 2021
@mattbennett mattbennett deleted the client-refactor branch February 4, 2021 15:13
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

Successfully merging this pull request may close these issues.

1 participant