Skip to content

Concurrency problems with shared client context #472

@dkocher

Description

@dkocher

Currently because the client HttpContext 1 is shared across executions of different requests there is a concurrency issue as the context should not be considered thread safe.

IMPORTANT: Please note HTTP context implementation, even when thread safe, may not be used concurrently by multiple threads, as the context may contain thread unsafe attributes. 2

This can cause issues with the authentication state (http.auth.target-scope) used in the request execution phase and user token (http.user-token) used to determine connection reuse from the pool. Both properties are stored in the context.

Relates to 3.

Footnotes

  1. https://github.com/lookfirst/sardine/blob/master/src/main/java/com/github/sardine/impl/SardineImpl.java#L169

  2. https://hc.apache.org/httpcomponents-core-4.4.x/current/httpcore/apidocs/org/apache/http/protocol/HttpContext.html

  3. Unexpected 401 when using SharePoint WebDav NTLM authentication iterate-ch/cyberduck#15127

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions