Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-7432

Thread pool clean up code can lead to infinite loops in ThreadLocal.get

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • Commons Threads 3.2.10
    • Commons Threads 3.2.16
    • Commons
    • None

    Description

      The thread local clean up code added in SLING-6261 leads to Threads stuck in ThreadLocal.get.

      I am working on a simplified test case, but the stack trace is similar to

      "pool-1-thread-1" prio=10 tid=0x00007f47f4374800 nid=0xb19 runnable [0x00007f47e734e000]
         java.lang.Thread.State: RUNNABLE
      	at java.lang.ThreadLocal$ThreadLocalMap.set(ThreadLocal.java:429)
      	at java.lang.ThreadLocal$ThreadLocalMap.access$100(ThreadLocal.java:261)
      	at java.lang.ThreadLocal.set(ThreadLocal.java:183)
      	at org.apache.sling.commons.threads.impl.ThreadPoolExecutorCleaningThreadLocalsTest$RunnableImplementation.run(ThreadPoolExecutorCleaningThreadLocalsTest.java:100)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            rombert Robert Munteanu
            rombert Robert Munteanu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment