lookfirst / sardine

an easy to use webdav client for java
Other
569 stars 184 forks source link

Concurrency problems with shared client context #472

Open dkocher opened 4 months ago

dkocher commented 4 months ago

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. ^3

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 ^2.

dkocher commented 4 months ago

Previously in #265 that does not cover all cases.