[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16439414#comment-16439414
 ] 

Oleg Kalnichevski commented on HTTPCLIENT-1915:
-----------------------------------------------

{{HttpClient}} instances are fully thread safe but some attributes stored in 
{{HttpContext}} are not, for instance {{RedirectLocations}} class. Please make 
sure your application does not share the same {{HttpContext}} instane between 
concurrent requests.

Oleg

> httpClient.execute not thread-safe with redirectLocations
> ---------------------------------------------------------
>
>                 Key: HTTPCLIENT-1915
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1915
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient (classic)
>    Affects Versions: 4.5.2
>         Environment: docker tomcat:7.0.72 (JRE 7)
>            Reporter: Nicolas Toublanc
>            Priority: Major
>
> Sometimes, with 2 simultaneous httpClient.execute, I got the following error:
> {code:java}
> java.util.ConcurrentModificationException: null at 
> java.util.AbstractList$Itr.remove(AbstractList.java:380) at 
> java.util.AbstractList.removeRange(AbstractList.java:571) at 
> java.util.AbstractList.clear(AbstractList.java:234) at 
> org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:102) at 
> org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
>  at 
> org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
>  at {code}
> The cause is redirectLocations collection (in RedirectExec.execute) not being 
> thread-safe:**
> {code:java}
>   final List<URI> redirectLocations = context.getRedirectLocations();
>         if (redirectLocations != null) {
>             redirectLocations.clear();
>         }{code}
> I can't figure where this collection is created.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to