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

Fix ResourceWarning unclosed socket and re-enable and fix tornado tests #801

Merged
merged 28 commits into from
Jan 23, 2024

Commits on Aug 7, 2023

  1. 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 committed Aug 7, 2023
    Configuration menu
    Copy the full SHA
    f414435 View commit details
    Browse the repository at this point in the history

Commits on Dec 15, 2023

  1. Configuration menu
    Copy the full SHA
    17c78bf View commit details
    Browse the repository at this point in the history
  2. enable filterwarnings=error

    graingert committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    556fd01 View commit details
    Browse the repository at this point in the history
  3. fix a KeyError

    graingert committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    fa789e9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    bddec2e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3919cb2 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f075c8b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    895ae20 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    97de8a0 View commit details
    Browse the repository at this point in the history
  9. fix httpx resource warnings

    graingert committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    73d11e8 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    cf76592 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    356ff41 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    80614db View commit details
    Browse the repository at this point in the history
  13. Revert "fix a KeyError"

    This reverts commit fa789e9.
    graingert committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    5cff354 View commit details
    Browse the repository at this point in the history
  14. Revert "Fix ResourceWarning unclosed socket"

    This reverts commit f414435.
    graingert committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    d76c243 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    d39c26b View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    8e13af2 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    cc4d03c View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    ee6e790 View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2024

  1. Configuration menu
    Copy the full SHA
    5104b1f View commit details
    Browse the repository at this point in the history
  2. restore pytest-tornado

    graingert committed Jan 23, 2024
    Configuration menu
    Copy the full SHA
    666686b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a093fb1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c6667ac View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    db1f5b0 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    6d7a842 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b7f6c2f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    42b4a5d View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    784b2dc View commit details
    Browse the repository at this point in the history