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

Concurrency problems with shared client context #472

Open
dkocher opened this issue Apr 24, 2024 · 1 comment
Open

Concurrency problems with shared client context #472

dkocher opened this issue Apr 24, 2024 · 1 comment
Assignees

Comments

@dkocher
Copy link
Collaborator

dkocher commented Apr 24, 2024

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

@dkocher dkocher self-assigned this Apr 24, 2024
@dkocher
Copy link
Collaborator Author

dkocher commented Apr 24, 2024

Previously in #265 that does not cover all cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant