-
Notifications
You must be signed in to change notification settings - Fork 376
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
Fix ResourceWarning unclosed socket and re-enable and fix tornado tests #801
Merged
graingert
merged 28 commits into
kevin1024:master
from
graingert:fix-resource-warning-2
Jan 23, 2024
Merged
Fix ResourceWarning unclosed socket and re-enable and fix tornado tests #801
graingert
merged 28 commits into
kevin1024:master
from
graingert:fix-resource-warning-2
Jan 23, 2024
Commits on Aug 7, 2023
-
Fix ResourceWarning unclosed socket
This PR fixes issue kevin1024#710 by properly closing the underlying socket. It first uses `pool._put_conn` to keep the connection in the pool, and later removes and closes it when the context manager exits. I was unsure about the exact purpose of the `ConnectonRemove` class, so I made minimal changes to minimize the risk of breaking the code and there may be better solutions for fixing this issue. For example, the `urllib3.connectionpool.HTTPConnectionPool` will utilize a weakref to terminate pool connections. By appending our connection to it, it will also take care of closing our connection. So another solution could be to modify the `__exit__` in `patch.ConnectionRemover` method and add our connection to the pool: ```py class ConnectionRemover: ... def __exit__(self, *args): for pool, connections in self._connection_pool_to_connections.items(): for connection in connections: if isinstance(connection, self._connection_class): pool._put_conn(connection) ```
Mohammad Razavi committedAug 7, 2023 Configuration menu - View commit details
-
Copy full SHA for f414435 - Browse repository at this point
Copy the full SHA f414435View commit details
Commits on Dec 15, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 17c78bf - Browse repository at this point
Copy the full SHA 17c78bfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 556fd01 - Browse repository at this point
Copy the full SHA 556fd01View commit details -
Configuration menu - View commit details
-
Copy full SHA for fa789e9 - Browse repository at this point
Copy the full SHA fa789e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for bddec2e - Browse repository at this point
Copy the full SHA bddec2eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3919cb2 - Browse repository at this point
Copy the full SHA 3919cb2View commit details -
Configuration menu - View commit details
-
Copy full SHA for f075c8b - Browse repository at this point
Copy the full SHA f075c8bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 895ae20 - Browse repository at this point
Copy the full SHA 895ae20View commit details -
Configuration menu - View commit details
-
Copy full SHA for 97de8a0 - Browse repository at this point
Copy the full SHA 97de8a0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 73d11e8 - Browse repository at this point
Copy the full SHA 73d11e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for cf76592 - Browse repository at this point
Copy the full SHA cf76592View commit details -
Configuration menu - View commit details
-
Copy full SHA for 356ff41 - Browse repository at this point
Copy the full SHA 356ff41View commit details -
Configuration menu - View commit details
-
Copy full SHA for 80614db - Browse repository at this point
Copy the full SHA 80614dbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5cff354 - Browse repository at this point
Copy the full SHA 5cff354View commit details -
Revert "Fix ResourceWarning unclosed socket"
This reverts commit f414435.
Configuration menu - View commit details
-
Copy full SHA for d76c243 - Browse repository at this point
Copy the full SHA d76c243View commit details -
Configuration menu - View commit details
-
Copy full SHA for d39c26b - Browse repository at this point
Copy the full SHA d39c26bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8e13af2 - Browse repository at this point
Copy the full SHA 8e13af2View commit details -
Configuration menu - View commit details
-
Copy full SHA for cc4d03c - Browse repository at this point
Copy the full SHA cc4d03cView commit details -
Configuration menu - View commit details
-
Copy full SHA for ee6e790 - Browse repository at this point
Copy the full SHA ee6e790View commit details
Commits on Jan 23, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 5104b1f - Browse repository at this point
Copy the full SHA 5104b1fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 666686b - Browse repository at this point
Copy the full SHA 666686bView commit details -
Configuration menu - View commit details
-
Copy full SHA for a093fb1 - Browse repository at this point
Copy the full SHA a093fb1View commit details -
Configuration menu - View commit details
-
Copy full SHA for c6667ac - Browse repository at this point
Copy the full SHA c6667acView commit details -
Configuration menu - View commit details
-
Copy full SHA for db1f5b0 - Browse repository at this point
Copy the full SHA db1f5b0View commit details -
fix test_tornado_exception_can_be_caught RuntimeError: generator rais…
…ed StopIteration
Configuration menu - View commit details
-
Copy full SHA for 6d7a842 - Browse repository at this point
Copy the full SHA 6d7a842View commit details -
Configuration menu - View commit details
-
Copy full SHA for b7f6c2f - Browse repository at this point
Copy the full SHA b7f6c2fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 42b4a5d - Browse repository at this point
Copy the full SHA 42b4a5dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 784b2dc - Browse repository at this point
Copy the full SHA 784b2dcView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.