Bug 458113 - IndexChangedEvents should be dispatched asynchronously
Summary: IndexChangedEvents should be dispatched asynchronously
Status: NEW
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 3.6   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-22 05:54 EST by Andreas Sewe CLA
Modified: 2015-01-22 05:54 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Sewe CLA 2015-01-22 05:54:03 EST
We at Code Recommenders just encountered a very surprising deadlock, documented in Bug 458073.

In a nutshell, the problem is that using JGit (not EGit, just the headless API) to perform a CheckoutCommand can cause a call to Display.syncExec.

Simplest scenario with just two threads:

  UI thread:
     scheduled job
     waits for some resource

  Job:
     locks resource
     performs CheckoutCommand and thus waits for UI thread

Granted, waiting on the UI thread for some resource may be considered bad practice, but I'm sure this will happen in the wild (and may be more likely if more than 2 threads are involved, as in Bug 458073). I am hence wondering whether it would be worthwhile to dispatch IndexChangedEvents asynchronously, as apparently the current implementation can cause waits for the UI thread in a completely innocent-looking code using plain JGit. Thoughts?