Skip to content

Cohttp_lwt_unix.Connection_cache.call hangs if the server is unreachable #1112

@lthms

Description

@lthms

Assuming no service is bound to 127.0.0.1:55000, the following minimal snippet will hang indefinitely.

  let cache = Cohttp_lwt_unix.Connection_cache.create ~parallel:1 () in
  Cohttp_lwt_unix.Connection_cache.call cache `GET
    (Uri.of_string "http://127.0.0.1:55000")

I quick look at the functor in Cohttp_lwt.Connection_cache and I guess the get_connection recursive function is to blame? I’ll try to dig deeper, but no matter the result of my search, I wanted to share my discovery.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions