Discussion:
deadlock when closing the session
Nitu Choudhary
2018-04-27 18:11:36 UTC
Permalink
Hi,
I am seeing a deadlock when trying to close the session, please check the stack trace below. The version of nio client we are using is:
          <dependency>


                <groupId>org.apache.httpcomponents</groupId>

                <artifactId>httpcore-nio</artifactId>

                <version>4.4.6</version>

            </dependency>

            <dependency>

                <groupId>org.apache.httpcomponents</groupId>

                <artifactId>httpasyncclient</artifactId>

                <version>4.1.3</version>

            </dependency>



Java stack information for the threads listed above:
===================================================

"Thread-313":

        at java.nio.channels.spi.AbstractSelectionKey.cancel(AbstractSelectionKey.java:70)

        - waiting to lock <0x00002b9628ab9860> (a sun.nio.ch.SelectionKeyImpl)

        at java.nio.channels.spi.AbstractSelectableChannel.implCloseChannel(AbstractSelectableChannel.java:240)

        - locked <0x00002b9628ab9b98> (a java.lang.Object)

        at java.nio.channels.spi.AbstractInterruptibleChannel.close(AbstractInterruptibleChannel.java:115)

        - locked <0x00002b9628ab9808> (a java.lang.Object)

        at org.apache.http.impl.nio.reactor.SessionRequestImpl.cancel(SessionRequestImpl.java:216)

        at org.apache.http.nio.pool.AbstractNIOConnPool.shutdown(AbstractNIOConnPool.java:216)

        at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.shutdown(PoolingNHttpClientConnectionManager.java:206)

        at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.close(CloseableHttpAsyncClientBase.java:99)

        at com.yahoo.ymail.common.http.internal.HttpAsyncClientJmxEnabled.close(HttpAsyncClientJmxEnabled.java:452)

        at com.yahoo.ymail.xmas.common.http.HttpAsyncClientWrapper$1.run(HttpAsyncClientWrapper.java:75)

        at java.lang.Thread.run(Thread.java:748)

"I/O dispatcher 119":

        at java.nio.channels.spi.AbstractInterruptibleChannel.close(AbstractInterruptibleChannel.java:111)

        - waiting to lock <0x00002b9628ab9808> (a java.lang.Object)

        at org.apache.http.impl.nio.reactor.IOSessionImpl.close(IOSessionImpl.java:227)

        - locked <0x00002b9628ab9860> (a sun.nio.ch.SelectionKeyImpl)

        at org.apache.http.impl.nio.reactor.IOSessionImpl.shutdown(IOSessionImpl.java:255)

        at org.apache.http.impl.nio.reactor.AbstractIODispatch.connected(AbstractIODispatch.java:89)

        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)

        at java.lang.Thread.run(Thread.java:748)






Regards,nitu
Oleg Kalnichevski
2018-04-27 21:55:04 UTC
Permalink
Post by Nitu Choudhary
Hi,
I am seeing a deadlock when trying to close the session, please check
Nitu

Could you please upgrade to the latest release of HttpCore and see if
that solves the problem?

Oleg
Post by Nitu Choudhary
          <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpcore-nio</artifactId>
                <version>4.4.6</version>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpasyncclient</artifactId>
                <version>4.1.3</version>
            </dependency>
===================================================
        at
java.nio.channels.spi.AbstractSelectionKey.cancel(AbstractSelectionKe
y.java:70)
        - waiting to lock <0x00002b9628ab9860> (a
sun.nio.ch.SelectionKeyImpl)
        at
java.nio.channels.spi.AbstractSelectableChannel.implCloseChannel(Abst
ractSelectableChannel.java:240)
        - locked <0x00002b9628ab9b98> (a java.lang.Object)
        at
java.nio.channels.spi.AbstractInterruptibleChannel.close(AbstractInte
rruptibleChannel.java:115)
        - locked <0x00002b9628ab9808> (a java.lang.Object)
        at
org.apache.http.impl.nio.reactor.SessionRequestImpl.cancel(SessionReq
uestImpl.java:216)
        at
org.apache.http.nio.pool.AbstractNIOConnPool.shutdown(AbstractNIOConn
Pool.java:216)
        at
org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.shu
tdown(PoolingNHttpClientConnectionManager.java:206)
        at
org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.close(Cl
oseableHttpAsyncClientBase.java:99)
        at
com.yahoo.ymail.common.http.internal.HttpAsyncClientJmxEnabled.close(
HttpAsyncClientJmxEnabled.java:452)
        at
com.yahoo.ymail.xmas.common.http.HttpAsyncClientWrapper$1.run(HttpAsy
ncClientWrapper.java:75)
        at java.lang.Thread.run(Thread.java:748)
        at
java.nio.channels.spi.AbstractInterruptibleChannel.close(AbstractInte
rruptibleChannel.java:111)
        - waiting to lock <0x00002b9628ab9808> (a java.lang.Object)
        at
org.apache.http.impl.nio.reactor.IOSessionImpl.close(IOSessionImpl.ja
va:227)
        - locked <0x00002b9628ab9860> (a sun.nio.ch.SelectionKeyImpl)
        at
org.apache.http.impl.nio.reactor.IOSessionImpl.shutdown(IOSessionImpl
.java:255)
        at
org.apache.http.impl.nio.reactor.AbstractIODispatch.connected(Abstrac
tIODispatch.java:89)
        at
org.apache.http.impl.nio.reactor.BaseIOReactor.sessionCreated(BaseIOR
eactor.java:248)
        at
org.apache.http.impl.nio.reactor.AbstractIOReactor.processNewChannels
(AbstractIOReactor.java:427)
        at
org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIO
Reactor.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)
        at java.lang.Thread.run(Thread.java:748)
Regards,nitu
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-***@hc.apache.org
For additional commands, e-mail: httpclient-users-***@hc.apache.org
Loading...