Uploaded image for project: 'HttpComponents HttpAsyncClient'
  1. HttpComponents HttpAsyncClient
  2. HTTPASYNC-154

Deadlock (?) when using HttpAsyncClient in Java 11

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Cannot Reproduce
    • 4.1.4
    • None
    • None
    • Ubuntu 19.04 amd64
      openjdk-8-jdk ~8u222-b10-1ubuntu1~19.04.1
      openjdk-11-jdk ~11.0.4+11-1ubuntu2~19.04

    Description

      I'm working on with a Java Webcrawler based on HttpAsyncClient, and I've encountered a situation where a deadlock occurs in Java 11, where it does not in Java 8. The software is based on a fork of crawler4j, jcrawler ( https://bintray.com/pointpro/jcrawler/JCrawler#files/nl%2Fpointpro%2Fjcrawler%2F2.0.0-snapshot-201910090600 to be exact)

      The lock occurs in `org.apache.http.nio.pool.AbstractNIOConnPool#lease(T, java.lang.Object, long, long, java.util.concurrent.TimeUnit, org.apache.http.concurrent.FutureCallback<E>)` on line 278 where the `ReentrantLock` `lock` is locked.

      A set of several dozen pages is fetched successfully, but after the 20th request, it just hangs there. A created a thread dump that shows the thread is waiting to lock, but the thread dump doesn't show any other thread locking this lock. It never acquires the lock - it just waits there indefinitely. I left it running for an hour or so before killing it. The lock AbstractNIOConnPool is waiting for never becomes available but no other thread seems to have locked it.

      I'm not sure where to begin gathering more information on this issue. The two versions I've tried are:

      openjdk-8-jdk ~8u222-b10-1ubuntu1~19.04.1

      and

      openjdk-11-jdk ~11.0.4+11-1ubuntu2~19.04

      I'm willing to collect additional information but I can see so many directions in where I can debug that I don't know where to start.

      I've switched back to Java 8 for now.

      Attachments

        Activity

          People

            Unassigned Unassigned
            MadEgg Egbert
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: