Summary: | SystemViewRemoteFileAdapter#internalGetChildren() should not be synchronized since it could deadlock | ||||||
---|---|---|---|---|---|---|---|
Product: | [Tools] Target Management | Reporter: | Martin Oberhuber <mober.at+eclipse> | ||||
Component: | RSE | Assignee: | 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
Martin Oberhuber
2007-08-10 09:51:49 EDT
For similar issues, see also bug 199565 and bug 199566. See bug #199573 comment 1 for an example how to fix issues with synchronized. Note that because there is only a single instance of the SystemViewRemoteFileAdapter, if ANY connection locks that one object through internalGetChildren(), NO other "remote files" connections will be able to get any children any more. This is obvious from the backtrace in bug 202758 comment 1, where an FTP connection gets stalled because the remote server doesn't answer any more. Due to the "synchronized" statements, no other connections will be able to get children; and, what's more, if any internalGetChildren() call should happen on a display thread, ALL of Eclipse will be stalled. Please re-think the situation why you believe this should be synchronized and try to come up with a solution (perhaps eliminating the "synchronized" statement). I tried taking out the synchronized for both SystemViewRemoteFileAdapter and I haven't been running into any concurrency issues. I do however see a couple of additional calls to IFileService.getFile() on the main thread (by the table view when it tries to compute layout and by the system view when it's trying to determine matching filters). I'm not sure if those can easily be avoided without risky changes right now. At least the synchronized doesn't seem to be required. Do you think it's safe enough to remove it at this stage? Take it out now, before the test pass this thursday. Even if we should run into trouble, the synchronized here is certainly not the right solution for it. Created attachment 78073 [details]
patch to remove synchronized
Here is the patch to remove the synchronized from internalGetChildren
Patch is good, as discussed. I've committed the patch for this to cvs. |