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

Teach http::client::make_request() to timeout #2304

Closed

Commits on Jun 26, 2024

  1. http/client: Add timeout argument to make_request()

    And propagate it down the call stack to the interesting places. Next
    patch will make the code obey the provided timeout.
    
    Signed-off-by: Pavel Emelyanov <[email protected]>
    xemul committed Jun 26, 2024
    Configuration menu
    Copy the full SHA
    5b3270e View commit details
    Browse the repository at this point in the history
  2. http/client: Respect user-provided timeout

    There are two places that can wait for undefined amount of time -- the
    one that waits the connection pool to release a connection and the one
    that establishes a new connection.
    
    The former is simple, as it uses conditional variable, so just wait() on
    it with the timeout and return back timeout error if it fired.
    
    Tha latter is trickier. New connections come from factory and it's not
    guaranteed that a factory obeys it (e.g. see scylladb#2302). So instead of
    relying on the factory, check if connected_socket appeared soon enough
    and return back timeout error if it didn't.
    
    Signed-off-by: Pavel Emelyanov <[email protected]>
    xemul committed Jun 26, 2024
    Configuration menu
    Copy the full SHA
    e0d0324 View commit details
    Browse the repository at this point in the history
  3. test/http: Generalize simple request sending

    There are several tests that call client::make_request() with some
    simple pre-defined request that's supposed to fail. Next patches will
    want to do the same, so prepare the helper function in advance.
    
    Signed-off-by: Pavel Emelyanov <[email protected]>
    xemul committed Jun 26, 2024
    Configuration menu
    Copy the full SHA
    5281ee2 View commit details
    Browse the repository at this point in the history
  4. test/http: Test how client::make_request() handles provided timeout

    Two cases to check -- that timing out factory is handled and that timing
    out pooled connection is handled.
    
    Signed-off-by: Pavel Emelyanov <[email protected]>
    xemul committed Jun 26, 2024
    Configuration menu
    Copy the full SHA
    8eedc90 View commit details
    Browse the repository at this point in the history