felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Berger (JIRA)" <j...@apache.org>
Subject [jira] Created: (FELIX-2378) Deadlock in Felix Shell implementation
Date Tue, 01 Jun 2010 11:55:36 GMT
Deadlock in Felix Shell implementation

                 Key: FELIX-2378
                 URL: https://issues.apache.org/jira/browse/FELIX-2378
             Project: Felix
          Issue Type: Bug
          Components: Shell
    Affects Versions: shell-1.4.2
         Environment: Felix Framework Version 2.0.5
SunOS castor 5.10 Generic_138888-06 sun4u sparc SUNW,Sun-Fire-V890
java version "1.6.0_12"
Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
Java HotSpot(TM) Server VM (build 11.2-b01, mixed mode)
            Reporter: Alexander Berger

The class org.apache.felix.shell.impl.Activator$ShellServiceImpl makes heavy use of synchronized
methods which synchronized on the ShellServiceImpl itself. This causes a deadlock if a refresh/resolve
(PackageAdmin) cycle is initiated using the shell and some Commands are about to be removed
from the OSGi service registry (as a result of the refresh/resolve).

This happens because executeCommand locks the ShellServiceImpl instance and later on when
the PackageAdmin indirectly triggers the removal of some registered Commands ShellServiceImpl.removeCommand(...)
will try to lock the same ShellServiceImpl instance which is still locked by the executeCommand.

I have created a patch for org.apache.felix.shell.impl.Activator (see Attachment) for a possible
solution of this problem.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message