Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 495512 - Deadlock on push while opening diff on a file
Summary: Deadlock on push while opening diff on a file
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.5   Edit
Assignee: Thomas Wolf CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 495582 (view as bug list)
Depends on:
Blocks: 496493 497161
  Show dependency tree
 
Reported: 2016-06-06 03:56 EDT by Andrey Loskutov CLA
Modified: 2016-07-02 12:46 EDT (History)
3 users (show)

See Also:


Attachments
Thread dump (34.62 KB, text/plain)
2016-06-06 03:56 EDT, Andrey Loskutov CLA
no flags Details
Screenshot (225.57 KB, image/png)
2016-06-06 03:57 EDT, Andrey Loskutov CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Loskutov CLA 2016-06-06 03:56:29 EDT
Created attachment 262252 [details]
Thread dump

Eclipse 4.6 RC4, Egit nightly 4.5.0.201606012324

From Staging view hit Commit + Push, and second later double clicked on a file in the unstaged area to see a diff.

The UI deadlocked in modal dialogs, see thread dump and the picture.
Comment 1 Andrey Loskutov CLA 2016-06-06 03:57:15 EDT
Created attachment 262253 [details]
Screenshot
Comment 2 Thomas Wolf CLA 2016-06-06 17:07:25 EDT
Darn. I thought we had that one nailed with using the topmost modal shell. Apparently not.

I still don't like throwing dialogs from background jobs at all. Maybe it's time to re-think that whole approach. Take a look at https://eclipse.org/articles/Article-Concurrency/jobs-api.html, especially "Example 2: User Feedback for Finished Jobs". Maybe we should do it that way.

The article is a bit old. Does anybody know if there are more modern APIs by now, or if that is still the way to do this?

Would be quite a bit of a departure from current feedback, though. The other alternative might be to use logic similar to ProgressManagerUtil -- basically use a job to open the dialog, but do so only if no modal shells are open. If there are any, reschedule. That'll delay the dialog to pop up until there are no modal shells. But sounds like a bit of a hack.
Comment 3 Andrey Loskutov CLA 2016-06-07 05:10:47 EDT
*** Bug 495582 has been marked as a duplicate of this bug. ***
Comment 4 Andrey Loskutov CLA 2016-06-07 05:16:00 EDT
(In reply to Thomas Wolf from comment #2)
> Darn. I thought we had that one nailed with using the topmost modal shell.
> Apparently not.
> 
> I still don't like throwing dialogs from background jobs at all. Maybe it's
> time to re-think that whole approach. 

I think we should associate jobs with actions, so that the job, if finished, can be clicked by the user and then we show the dialog. 

For the transition time we can give an option to disable this and keep the old behavior, but I think given the severity of the problems we face we should just stop spamming users with modal dialogs.
Comment 5 Matthias Sohn CLA 2016-06-07 07:06:48 EDT
+1

in addition we could introduce a git console showing executed commands and allowing to access result details

also see these related enhancement requests:
bug 349551 "Log EGit activities into a console"
bug 378056 "Add an interactive git console"
bug 399776 "Don't show a dialog for each commit+push, but log to a Git Console view instead"
Comment 6 Eclipse Genie CLA 2016-06-09 00:57:27 EDT
New Gerrit change created: https://git.eclipse.org/r/74954
Comment 7 Thomas Wolf CLA 2016-06-09 01:14:53 EDT
(In reply to Eclipse Genie from comment #6)
> New Gerrit change created: https://git.eclipse.org/r/74954

Uses actions associated with jobs. No flag to get the old behavior; I don't want a flag enabling buggy behavior. No "git console" either, that'd be a completely different and new feature.
Comment 8 Eclipse Genie CLA 2016-07-02 12:40:12 EDT
Gerrit change https://git.eclipse.org/r/74954 was merged to [master].
Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=09e0d369d3721bb844e0f60355efccc52381d5be
Comment 9 Andrey Loskutov CLA 2016-07-02 12:46:57 EDT
Thanks Thomas!