Bug 199565 - DStoreConnectorService#internalConnect() should not be synchronized since it could deadlock
Summary: DStoreConnectorService#internalConnect() should not be synchronized since it ...
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-10 09:48 EDT by Martin Oberhuber CLA
Modified: 2007-09-13 10:29 EDT (History)
0 users

See Also:
mober.at+eclipse: review+


Attachments
patch for taking out the synchronization (1.51 KB, patch)
2007-09-12 16:28 EDT, David McKnight CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2007-08-10 09:48:02 EDT
DStoreConnectorService#internalConnect() is synchronized, but calls out to other methods below it.

This construct could deadlock easily, since it is very similar to the one fixed with bug #199552 -- see the comments there for information how the deadlock actually happened.

Please investigate why you think the method must be synchronized, and either get rid of the synchronized statement or find an alternative way of synchronization. Take care of bug #149188 comment 4, it shows one reason why the synchronized could be there (to avoid multiply connecting the same subsystem, in this case).
Comment 1 Martin Oberhuber CLA 2007-08-10 09:52:39 EDT
For similar issues, see also bug 199566 and bug 199568.
Comment 2 Martin Oberhuber CLA 2007-08-10 10:16:54 EDT
See bug #199573 comment 1 for an example how to fix issues with synchronized.
Comment 3 David McKnight CLA 2007-09-12 16:28:00 EDT
Created attachment 78230 [details]
patch for taking out the synchronization
Comment 4 David McKnight CLA 2007-09-12 16:30:02 EDT
I've applied the patch to cvs already, since this change is fairly trivial and I didn't see any problems with basic tests.  
Comment 5 Martin Oberhuber CLA 2007-09-12 16:35:43 EDT
fine, thanks
Comment 6 David McKnight CLA 2007-09-13 10:29:22 EDT
marking this as fixed since I committed the changes yesterday.