New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
View changed submodule could hang GE #9122
View changed submodule could hang GE #9122
Conversation
GitUI/GitUIExtensions.cs
Outdated
var status = ThreadHelper.JoinableTaskFactory.Run( | ||
() => file.GetSubmoduleStatusAsync() ?? Task.FromResult<GitSubmoduleStatus?>(null)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps:
var status = ThreadHelper.JoinableTaskFactory.Run( | |
() => file.GetSubmoduleStatusAsync() ?? Task.FromResult<GitSubmoduleStatus?>(null)); | |
GitSubmoduleStatus? status = file.GetSubmoduleStatusAsync()?.GetAwaiter().GetResult(); |
BTW: GetSubmoduleStatusAsync
turned into a property would avoid the misleading call ()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used what @drewnoakes suggested
This is hopefully a short term fix only
Will test this some time...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That change hangs GE so I will not change
Temporary fix for gitextensions#8914 from gitextensions#9122
Temporary fix for gitextensions#8914
0bae071
to
6afe471
Compare
@msftbot merge in 24 hours |
Hello @gerhardol! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
Temporary fix for gitextensions#8914
The tests timed out similar to #8923 so I reverted to my original workaround that seem to be OK. |
I have rebuilt this on AppVeyor six times now, with #8923 ish solutions the builds failed 2 out of 3 so I believe this solution is OK (it is similar to pre #8881 that introduced the issue). Note that the check is changed, always entering the if(isSubmodule), not checking for task. The proper change should restore the assumption that the task is not evaluated though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks better.
Since this will be reworked anyway, we could continue the discussion after merging.
{ | ||
// Patch already evaluated | ||
var status = ThreadHelper.JoinableTaskFactory.Run(() => task); | ||
var status = ThreadHelper.JoinableTaskFactory.Run(file.GetSubmoduleStatusAsync!); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Rant: The syntax of
!
is weird in this case. It applies to the return value of the functionfile.GetSubmoduleStatusAsync
, which is not called here - but later byRun
. - Are we sure that
file._submoduleStatus
is nevernull
?
- Does
JoinAsync()
always return the sameTask
instance?GetSubmoduleStatusAsync()
is called pretty often.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This is compiler info to ignore that the value may be null, it does not matter that function is not called
- GetSubmoduleStatus is currently always set. Anyway, this is a fix for the current solution that hangs if status is not yet ready
- Do not know, I assume so
Annoying that the branch was merged also when auto merge was removed, a fixup! was merged. (block-fixup should be enough to stop this) |
I'll check with the msftbot team.
|
Temporary fix for #8914 (not closing #8914)
The proper fix is in #8923, but that PR introduces some test instabilities so the app code is patched instead.
Proposed changes
Do not hang the application when submodule status is not evaluated when viewing.
Test methodology
Manual.
You may have to insert the error by installing Symantec or adding a delay to submodule status calculation.
✒️ I contribute this code under The Developer Certificate of Origin.