Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-2378

Deadlock in Felix Shell implementation

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • shell-1.4.2
    • shell-1.4.3
    • Shell
    • None

    Description

      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.

      Attachments

        1. Activator.patch
          5 kB
          Alexander Berger

        Activity

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

          People

            rickhall Richard S. Hall
            alexberger Alexander Berger
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment