Skip to content

RestCatalog: concurrent HTTP requests can crash in libcurl #20

Description

@smaheshwar-pltr

HttpClient sends every request through one cpr::ConnectionPool (http_client.cc#L158), which wraps a libcurl share handle with CURL_LOCK_DATA_CONNECT. libcurl does not support sharing connections between threads, so when two requests overlap, the process can crash inside libcurl.

A RestCatalog sends its requests through one HttpClient, so they can overlap even if the application only uses the catalog from one thread:

Applications that share a catalog across threads hit it directly (see #21). We found it in a DuckDB extension's concurrency test.

The shared pool came in with apache#530, which replaced a mutex-guarded cpr::Session. #19 gives each in-flight request its own pool. Reproduction in the first comment.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions