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 leaky file descriptors and reuse socket for persistent connections #976

Merged
merged 4 commits into from Aug 2, 2022

Commits on May 24, 2022

  1. Calling Net::HTTP#start should assign a socket

    When explicitly calling `Net::HTTP#start`, a stub socket should be
    initialized.
    rzane committed May 24, 2022
    Copy the full SHA
    18dc8a9 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    7a2a406 View commit details
    Browse the repository at this point in the history
  3. Close the socket before spawning a new one

    When using a persistent connection, new sockets will be created for
    every single request and they are never closed.
    
    This commit makes it so that the current socket is closed before a new
    one is connected.
    rzane committed May 24, 2022
    Copy the full SHA
    3d3bdc2 View commit details
    Browse the repository at this point in the history
  4. Reuse persistent connection

    When using a persistent connection, the point is to reuse the underlying
    socket. Prior to this commit, the socket would be thrown away before
    each request unless `net_http_connect_on_start` is `true`.
    
    This commit will preserve the previously started socket if the socket
    represents an actual connection.
    rzane committed May 24, 2022
    Copy the full SHA
    eeb1392 View commit details
    Browse the repository at this point in the history