Bug 132239 - Deadlock during Framework.close
Summary: Deadlock during Framework.close
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: 3.2   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.2 M6   Edit
Assignee: equinox.framework-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2006-03-16 15:06 EST by Simon Kaegi CLA
Modified: 2006-08-23 15:20 EDT (History)
0 users

See Also:


Attachments
change to adminpermissions lock scope (2.33 KB, patch)
2006-03-16 15:07 EST, Simon Kaegi CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Kaegi CLA 2006-03-16 15:06:17 EST
I'm running into a deadlock while Framework.close() is occuring.
What's happening is that another thread logging various shutdown events ends up calling methods that boils down to a Framework.getAdminPermission() which uses the same Framework lock.

The Framework.getAdminPermissions(...) method is synchronized to protect the "adminPermissions" cache. To prevent this deadlock I believe the lock can safely have its scope reduced to just the "adminPermissions" object instead of the Framework. 

I've done some analysis and don't think this will have any undesirable side-effects but would definitely appreciate someone else taking a look.
Comment 1 Simon Kaegi CLA 2006-03-16 15:07:43 EST
Created attachment 36436 [details]
change to adminpermissions lock scope
Comment 2 Thomas Watson CLA 2006-03-16 16:07:53 EST
Good catch.  Thanks Simon.  I have reviewed and released the fix.

[contributed patch applied]
Comment 3 Thomas Watson CLA 2006-08-23 15:20:28 EDT
adding "contributed" keyword to patches contributed by the community.