Skip to content

Add retries to publish steps - #7892

Merged
Dan Moseley (danmoseley) merged 1 commit into
microsoft:mainfrom
danmoseley:retries1
Mar 5, 2025
Merged

Dan Moseley (danmoseley) merged 1 commit into
microsoft:mainfrom
danmoseley:retries1

Conversation

@danmoseley

Copy link
Copy Markdown
Contributor

attempt to work around DCP log locking causing

System.IO.IOException: The process cannot access the file 'D:\a_work\1\a\artifacts\log\dcp\dcpctrl-1741041174-9644.log' because it is being used by another process.

@danmoseley

Copy link
Copy Markdown
Contributor Author

I chose 10 because the time between retries would then have summed to over 2 minutes. https://learn.microsoft.com/en-us/azure/devops/pipelines/process/tasks?view=azure-devops&tabs=yaml#number-of-retries-if-task-failed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR Overview

This PR adds a retry mechanism to address file locking issues encountered during artifact and log publishing in the pipeline.

  • Introduces a new parameter (retryCountOnTaskFailure: 10) in the artifact publishing step.
  • Adds the same retry mechanism to the logs publishing step, in both the common and official job templates.

Reviewed Changes

File Description
eng/common/templates/job/job.yml Adds retryCountOnTaskFailure for both artifact and log publishing steps
eng/common/templates-official/job/job.yml Adds retryCountOnTaskFailure for artifact and log publishing steps

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (4)

eng/common/templates/job/job.yml:49

  • [nitpick] Consider adding tests to verify that the new retry mechanism resolves file locking issues during artifact publishing.
retryCountOnTaskFailure: 10 # for any logs being locked

eng/common/templates/job/job.yml:60

  • [nitpick] Consider adding tests to verify that the new retry mechanism resolves file locking issues during log publishing.
retryCountOnTaskFailure: 10 # for any logs being locked

eng/common/templates-official/job/job.yml:33

  • [nitpick] Consider adding tests to verify that the new retry mechanism resolves file locking issues during artifact publishing in the official template.
retryCountOnTaskFailure: 10 # for any logs being locked

eng/common/templates-official/job/job.yml:42

  • [nitpick] Consider adding tests to validate that the retry mechanism properly handles file locking during log publishing in the official template.
retryCountOnTaskFailure: 10 # for any logs being locked

@danmoseley
Dan Moseley (danmoseley) enabled auto-merge (squash) March 5, 2025 01:06
@danmoseley
Dan Moseley (danmoseley) merged commit 33a7fcc into microsoft:main Mar 5, 2025
@danmoseley
Dan Moseley (danmoseley) deleted the retries1 branch March 5, 2025 15:14
PathtoPublish: '$(Build.ArtifactStagingDirectory)/artifacts'
ArtifactName: ${{ coalesce(parameters.artifacts.publish.artifacts.name , 'Artifacts_$(Agent.Os)_$(_BuildConfig)') }}
condition: always()
retryCountOnTaskFailure: 10 # for any logs being locked

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Changes to eng/common will get overwritten by the next update from dotnet/arcade - looks like that happens once per month in Aspire. Any idea why publishing is failing so frequently here?

PathtoPublish: '$(Build.ArtifactStagingDirectory)/artifacts'
ArtifactName: ${{ coalesce(parameters.artifacts.publish.artifacts.name , 'Artifacts_$(Agent.Os)_$(_BuildConfig)') }}
condition: always()
retryCountOnTaskFailure: 10 # for any logs being locked

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Changes to eng/common will get overwritten by the next update from dotnet/arcade - looks like that happens once per month in Aspire. Any idea why publishing is failing so frequently here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can instead add a step to explicitly wait for dcp/dcpctrl processes to end.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@github-actions github-actions Bot added the area-codeflow for labeling automated codeflow. intentionally a different color! label Mar 10, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-codeflow for labeling automated codeflow. intentionally a different color!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants