Skip to content
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

CommitInfo: Fix up threading issues #9205

Merged
merged 3 commits into from May 16, 2021
Merged

Conversation

mstv
Copy link
Member

@mstv mstv commented May 13, 2021

Fixes #9204

Proposed changes

  • Switch to UI thread before calling CommitInfo.UpdateRevisionInfo
    That's why it should go into 3.5.1, too.
  • Join async operations before disposing CommitInfo
  • Speed up tests by AppSettings.ShowAvailableDiffTools = false

Screenshots

N/A

Test methodology

  • manual
  • run unit & integration tests

Test environment(s)

  • Git Extensions 0.0.0.0
  • Build d25e640
  • Git 2.31.1.windows.1
  • Microsoft Windows NT 10.0.19042.0
  • .NET 5.0.6
  • DPI 96dpi (no scaling)

✒️ I contribute this code under The Developer Certificate of Origin.

@mstv mstv self-assigned this May 13, 2021
Copy link
Member

@gerhardol gerhardol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

GitUI/CommitInfo/CommitInfo.cs Show resolved Hide resolved
@mstv mstv merged commit d3c38e6 into gitextensions:master May 16, 2021
@ghost ghost added this to the 3.6 milestone May 16, 2021
@mstv mstv modified the milestones: 3.6, 3.5.1 May 16, 2021
@mstv mstv deleted the fix/net5_tests branch May 16, 2021 17:37
mstv added a commit that referenced this pull request May 16, 2021
`CommitInfo`: Fix up threading issues

(cherry picked from commit d3c38e6)
@mstv
Copy link
Member Author

mstv commented May 16, 2021

Cherry-picked to release/3.5 and added to milestone 3.5.1.

if (disposing)
{
_asyncLoadCancellation.CancelCurrent();
ThreadHelper.JoinPendingOperations(); // those run with FileAndForget
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be reworked somehow?
This awaits all FileAndForget(), not just those created by this form.

When trying to find a solution for #9440 and add cancellation token that are disposed in REvDiff, RevGrid Dispose(), they are not executed until this has finished. So the tokens are not cancelled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integration Tests: ObjectDisposedException
3 participants