sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Munteanu (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (SLING-7432) Thread pool clean up code can lead to infinite loops in ThreadLocal.get
Date Tue, 23 Jan 2018 21:28:00 GMT

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

Robert Munteanu edited comment on SLING-7432 at 1/23/18 9:27 PM:
-----------------------------------------------------------------

Interesting, I did not know about that. I looked briefly at the code and all that I found
was the passing of 'inheritable' thread locals

{code:java}
        if (inheritThreadLocals && parent.inheritableThreadLocals != null)
            this.inheritableThreadLocals =
                ThreadLocal.createInheritedMap(parent.inheritableThreadLocals);
{code}

Do you have any other references for the default thread locals? I'd like to make sure I don't
mess anything up related to that.

_Edit_: formatting


was (Author: rombert):
Interesting, I did not know about that. I looked briefly at the code and all that I found
was the passing of 'inheritable' thread locals

{code:java}
        if (inheritThreadLocals && parent.inheritableThreadLocals != null)
            this.inheritableThreadLocals =
                ThreadLocal.createInheritedMap(parent.inheritableThreadLocals);
{code:java}

Do you have any other references for the default thread locals? I'd like to make sure I don't
mess anything up related to that.

> Thread pool clean up code can lead to infinite loops in ThreadLocal.get
> -----------------------------------------------------------------------
>
>                 Key: SLING-7432
>                 URL: https://issues.apache.org/jira/browse/SLING-7432
>             Project: Sling
>          Issue Type: Bug
>          Components: Commons
>    Affects Versions: Commons Threads 3.2.10
>            Reporter: Robert Munteanu
>            Assignee: Robert Munteanu
>            Priority: Blocker
>             Fix For: Commons Threads 3.2.14
>
>
> 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
> {noformat}
> "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)
> {noformat}



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

Mime
View raw message