Bug 199565

Summary: DStoreConnectorService#internalConnect() should not be synchronized since it could deadlock
Product: [Tools] Target Management Reporter: Martin Oberhuber <mober.at+eclipse>
Component: RSEAssignee: David McKnight <dmcknigh>
Status: RESOLVED FIXED QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: normal    
Priority: P2 Flags: mober.at+eclipse: review+
Version: 2.0   
Target Milestone: 2.0.1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
patch for taking out the synchronization none

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.