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

Timothy J Vogel Sr commented on FELIX-5922:
-------------------------------------------

I am getting similar exceptions from an Eclipse RCP application.  This 
exception repeats for many different bundles when the application exits.

java.lang.InterruptedException: null
        at 
java.base/java.util.concurrent.locks.ReentrantLock$Sync.tryLockNanos(ReentrantLock.java:167)
        at 
java.base/java.util.concurrent.locks.ReentrantLock.tryLock(ReentrantLock.java:479)
        at 
org.apache.felix.scr.impl.Activator$ScrExtension.destroy(Activator.java:282)
        at 
org.apache.felix.scr.impl.AbstractExtender$1.run(AbstractExtender.java:216)
        at 
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at 
org.apache.felix.scr.impl.AbstractExtender.destroyExtension(AbstractExtender.java:238)
        at 
org.apache.felix.scr.impl.AbstractExtender.stop(AbstractExtender.java:84)
        at org.apache.felix.scr.impl.Activator.stop(Activator.java:183)


 

> Use of Thread.interrupt() is incorrect for the shell.Activator
> --------------------------------------------------------------
>
>                 Key: FELIX-5922
>                 URL: https://issues.apache.org/jira/browse/FELIX-5922
>             Project: Felix
>          Issue Type: Bug
>          Components: Gogo Shell
>    Affects Versions: gogo.shell-1.1.0
>            Reporter: Tom Watson
>            Priority: Major
>
> org.apache.felix.gogo.shell.Activator.StartShellJob.terminate()
> The StartShellJob.terminate() method ends up interrupting the current thread. 
>  It appears that the terminate() method is attempting to terminate the run() 
> method by interrupting the thread executing the StartShellJob task that was 
> submitted to the executor.  The problem is the terminate() method gets called 
> by other threads outside the executor thread running the StartShellJob.  If 
> the intention of the terminate method is to interrupt the executor thread 
> running the StartShellJob then the running thread should be captured in the 
> StartShellJob.run() method and that thread should be interrupted from 
> terminate()
> The way the code is now the thread stopping the gogo.shell bundle ends up 
> being interrupted during Activator.stop(BunleContext) and it remains 
> interrupted upon exit of stop.  This causes other odd behavior if that thread 
> continues to be used to stop other bundles. For example, SCR checks for the 
> interrupted flag:
> {quote}The wait for bundle com.ibm.ws.org.apache.felix.gogo.command/70 being 
> started before destruction has been interrupted. 
> Bundle:com.ibm.ws.org.apache.felix.scr(id=13) java.lang.InterruptedException
>         at 
> java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireNanos(AbstractQueuedSynchronizer.java:1245)
>         at 
> java.util.concurrent.locks.ReentrantLock.tryLock(ReentrantLock.java:442)
>         at 
> org.apache.felix.scr.impl.Activator$ScrExtension.destroy(Activator.java:280)
>         at 
> org.apache.felix.scr.impl.AbstractExtender$1.run(AbstractExtender.java:216)
>         at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>         at 
> org.apache.felix.scr.impl.AbstractExtender.destroyExtension(AbstractExtender.java:238)
>         at 
> org.apache.felix.scr.impl.AbstractExtender.bundleChanged(AbstractExtender.java:132)
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to