| Summary: | [ui] MarkOccurrenceJob can cause deadlock | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Knut Wannheden <knut.wannheden> | ||||||||
| Component: | Xtext | Assignee: | Jan Koehnlein <jan> | ||||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | christian.dietrich.opensource, tmf.xtext-inbox | ||||||||
| Version: | 2.0.1 | Flags: | jan:
indigo+
|
||||||||
| Target Milestone: | SR2 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Knut Wannheden
Created attachment 203754 [details]
patch for OccurrenceMarker
Actually the JobManager automatically takes care of rescheduling an already running job, so the only things I suggest changing is setting it as a system job and using the DECORATE priority.
Apparently the EditorResourceAccess at least requires the UI thread to call IWorkbench#getActiveWorkbenchWindow() in #getOpenDocument(). So if that's how the current open editor must be obtained, then I suppose it should be possible to wrap just that part into a DisplayRunnableWithResult. At least that seems to work for the OccurrenceMarker and should not result in any deadlocks. Created attachment 203761 [details]
updated patch
The attached patch modifies the OccurrenceMarker and the EditorResourceAccess classes as proposed.
Created attachment 204015 [details]
New patch
Thanks for the patch.
We need to be on the UI tread to access the active workbench page, and thereafter the editor and its document if it is opened. I guess it is a good idea to hold the UI lock until the document is determined to avoid problems with closing editors. It should be safe to release it for the actual IUnitOfWork.
I've modified the patch with regard to that. Please revise.
(In reply to comment #4) > I've modified the patch with regard to that. Please revise. Looks good to me. Patch committed. Fixed. *** Bug 353332 has been marked as a duplicate of this bug. *** Closing all bugs that were set to RESOLVED before Neon.0 Closing all bugs that were set to RESOLVED before Neon.0 |