[
https://issues.apache.org/jira/browse/FELIX-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12912675#action_12912675
]
Richard S. Hall commented on FELIX-2598:
----------------------------------------
This appears to be a logic bug in how we check whether or not we can get the
bundle lock in acquireBundleLock(). We allow bundles already holding bundle
locks to continue holding them when the global lock is acquired, but we don't
want new bundle locks to be acquired. The idea is that in most cases only a
single bundle lock is required to perform an operation so the existing threads
holding bundle locks should be able to complete. If the global lock holder
needs a locked bundle, it just needs to wait for the holder to finish.
The logic error is that we block a thread from acquiring the bundle lock of a
lock it already owns, which isn't correct, it should be reentrant. We need to
specifically check for this case in the condition of our wait loop.
> Hang in Felix: thread owing a bundle lock waits for ever to lock it again
> -------------------------------------------------------------------------
>
> Key: FELIX-2598
> URL: https://issues.apache.org/jira/browse/FELIX-2598
> Project: Felix
> Issue Type: Bug
> Components: Framework
> Affects Versions: framework-3.0.2
> Reporter: Sahoo
> Assignee: Richard S. Hall
> Fix For: framework-3.0.3
>
> Attachments: hang.txt
>
>
> In GlassFish, I detected a hang. PFA jstack output. The scenario happens like
> this:
> a) I updated a bundle using telnet console. This thread is holding the bundle
> lock.
> b) Upon receiving the UPDATED event, one of our extenders bundle enhances the
> bundle and calls PackageAdmin.refreshPackages(bundle).
> c) PackageAdmin thread holds the global lock and tries to hold the bundle
> lock, which is currently held by telnetconsole thread.
> d) telnetconsole thread is waiting indefinitely to obtain the bundle lock.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.