You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Oleg Kalnichevski (JIRA)" <ji...@apache.org> on 2019/04/05 12:03:00 UTC

[jira] [Commented] (HTTPCORE-574) Race condition if connection request succeeds and times out at the same time

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

Oleg Kalnichevski commented on HTTPCORE-574:
--------------------------------------------

[~george.chigrichenko] I am not sure I understand how this could be possible given that the underlying selection key gets immediately cancelled and the connection channel immediately closed upon request timeout. This is the only potential fix I can think of

https://github.com/ok2c/httpcore/commit/aa812282f26fdd1975233a892c5405fa0da781b4

If it does not solve the problem for you please put together a self-contained standalone test app reproducing the defect outside your application environment and will take at a look at it. 

Oleg

> Race condition if connection request succeeds and times out at the same time
> ----------------------------------------------------------------------------
>
>                 Key: HTTPCORE-574
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-574
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore NIO
>    Affects Versions: 4.4.10
>            Reporter: George Chigrichenko
>            Priority: Major
>
> [#|2019-04-03T22:23:40.325+0000|SEVERE|glassfish 4.1|org.apache.http.impl.nio.client.InternalHttpAsyncClient|_ThreadID=617;_ThreadName=pool-163-thread-1;_TimeMillis=1554330220325;_LevelValue=1000;|I/O reactor terminated abnormally
> org.apache.http.nio.reactor.IOReactorException: I/O dispatch worker terminated abnormally
> 	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:356)
> 	at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:221)
> 	at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64)
> 	at java.lang.Thread.run(Thread.java:748)
> Caused by: java.lang.IllegalStateException: Connection must be created by connection manager
> 	at org.apache.http.impl.nio.client.InternalIODispatch.createConnection(InternalIODispatch.java:56)
> 	at org.apache.http.impl.nio.client.InternalIODispatch.createConnection(InternalIODispatch.java:39)
> 	at org.apache.http.impl.nio.reactor.AbstractIODispatch.connected(AbstractIODispatch.java:70)
> 	at org.apache.http.impl.nio.reactor.BaseIOReactor.sessionCreated(BaseIOReactor.java:248)
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processNewChannels(AbstractIOReactor.java:427)
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:287)
> 	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
> 	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588)
> thread that timed out
> 2019-04-03T22:23:39.000Z
> .... WARNING|glassfish 4.1|com.singularity.ee.controller.beans.analytics.scheduledquery.DefaultScheduledQueryManager|_ThreadID=612;_ThreadName=__ejb-thread-pool16;_TimeMillis=1554330219308;_LevelValue=900;|The async task has timed out
> java.util.concurrent.TimeoutException
> 	at org.apache.http.concurrent.BasicFuture.get(BasicFuture.java:106)
> 	at org.apache.http.impl.nio.client.FutureWrapper.get(FutureWrapper.java:75)
> Making another one since it was most likely not fixed in HTTPCORE-370 



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

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