Skip to content

Ensure cache cleanup after async shutdown failures - #171

Open
Amaury Levé (Evangelink) wants to merge 2 commits into
microsoft:mainfrom
Evangelink:dev/amauryleve/release-cache-resources
Open

Ensure cache cleanup after async shutdown failures#171
Amaury Levé (Evangelink) wants to merge 2 commits into
microsoft:mainfrom
Evangelink:dev/amauryleve/release-cache-resources

Conversation

@Evangelink

Copy link
Copy Markdown
Member

A failed asynchronous publish or materialization currently prevents plugin teardown, leaving cache resources and process-wide locks held for later builds in the same MSBuild node.

This change records shutdown failures, always runs disposal, continues cleanup across individual disposal errors, and rethrows the original shutdown exception when it is the only failure. Focused regression tests cover cache-client disposal, exception identity, and reacquiring both directory and process-wide locks.

Validation

  • Focused regression tests on net9.0 and net472: 4 passed
  • Full Common test suite on net9.0: 139 passed
  • Full solution build: succeeded with 0 warnings and 0 errors

Fixes: #163

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Comment thread src/Common/MSBuildCachePluginBase.cs Outdated
Comment thread src/Common/MSBuildCachePluginBase.cs Outdated
Comment thread src/Common/MSBuildCachePluginBase.cs Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@Evangelink
Amaury Levé (Evangelink) force-pushed the dev/amauryleve/release-cache-resources branch from c717bb5 to c3d7766 Compare August 6, 2026 22:53
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

Always release cache resources when async shutdown fails

2 participants