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

When clients disconnect protocol objects remain on the server side #43

Closed
fried opened this issue Sep 12, 2020 · 1 comment
Closed

When clients disconnect protocol objects remain on the server side #43

fried opened this issue Sep 12, 2020 · 1 comment

Comments

@fried
Copy link
Contributor

fried commented Sep 12, 2020

circular references.

The protocol references the transport which references the protocol.
The stream_writer has a bunch of references to the protocol which references the stream_writer
the stream_reader has a reference to the protocol which references the stream_reader.

I used weakref.finalize to print when the writer or the protocol get deleted and they don't get deleted until python is shutdown.

    weakref.finalize(writer, print, "writer was deleted.")
    weakref.finalize(writer._protocol, print, "protocol deleted.")

Let me organize my changes into a pull request for a fix

@jquast
Copy link
Owner

jquast commented Sep 13, 2020

Thanks!! PR was merged, and, I added similar weakref.proxy() wrapper to the Client as well. I will release 1.0.3 to pypi shortly.

@jquast jquast closed this as completed Sep 13, 2020
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

2 participants