mono / monodevelop

MonoDevelop is a cross platform .NET IDE
http://www.monodevelop.com
2.84k stars 1.02k forks source link

Fixes VSTS Bug 1027415: [FATAL] SigTerm signal in MonoDevelop.VersionControl.Git.dll!MonoDevelop.VersionControl.Git.GitRepository::Dispose+49 #9425

Closed mkrueger closed 4 years ago

mkrueger commented 4 years ago

MonoDevelop.VersionControl.Git.dll!MonoDevelop.VersionControl.Git.TaskFailureExtensions::RunWaitAndCapture+0

https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1027415

Hard to reproduce the issue (only 4 Hits). The GitConfigurationDialog does some long running operations where the cancellation token isn't passed to these. That got fixed.

But the main issue is the Dispose that could dead lock on the GitRepository. Since destroy is done on the dedicated operation thread it may dead lock in some situations. That can only happen if something long running blocks the DedicatedOperationFactory. Now the DedicatedOperationFactory operations get linked to the disposeToken which should cancel these operations. But all actions need to get the combined token and use that for their cancellations.

sevoku commented 4 years ago

@mkrueger some tests are still failing and this needs a manual rebase. Also it seems that 1027417 has been fixed with https://github.com/mono/monodevelop/pull/9421, did you mean to fix 1027415 here?

sevoku commented 4 years ago

@monojenkins rebase

sevoku commented 4 years ago

@monojenkins backport release-8.4

monojenkins commented 4 years ago

@sevoku backporting to release-8.4 failed, the patch results in conflicts:

Applying: Fixes VSTS Bug 1027415: [FATAL] SigTerm signal in MonoDevelop.VersionControl.Git.dll!MonoDevelop.VersionControl.Git.GitRepository::Dispose+49
Using index info to reconstruct a base tree...
M   main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs
.git/rebase-apply/patch:430: trailing whitespace.

.git/rebase-apply/patch:605: space before tab in indent.
            await DeleteCore (localPaths, keepLocal, monitor).ConfigureAwait (false);
warning: 2 lines add whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs
CONFLICT (content): Merge conflict in main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs
error: Failed to merge in the changes.
Patch failed at 0001 Fixes VSTS Bug 1027415: [FATAL] SigTerm signal in MonoDevelop.VersionControl.Git.dll!MonoDevelop.VersionControl.Git.GitRepository::Dispose+49

Please backport manually!