Skip to content

ci: avoid cache save during racy cancellation of GitHub Actions jobs#1087

Merged
cpcloud merged 1 commit intoNVIDIA:mainfrom
cpcloud:replace-always-with-not-cancelled
Oct 6, 2025
Merged

ci: avoid cache save during racy cancellation of GitHub Actions jobs#1087
cpcloud merged 1 commit intoNVIDIA:mainfrom
cpcloud:replace-always-with-not-cancelled

Conversation

@cpcloud
Copy link
Copy Markdown
Contributor

@cpcloud cpcloud commented Oct 6, 2025

This PR addresses an issue with our caching.

Currently, it's possible for a step in a job to run after it's been cancelled:

https://github.com/NVIDIA/cuda-python/actions/runs/18283715504/job/52053054074

There, the actions/cache/save action runs after being cancelled by a higher priority
job.

All well and good, except that the condition of running the Upload CTK cache--the step that uses actions/cache/save--
contains always().

According to the GitHub documentation for always(), that includes possibly running a step even if its parent job is cancelled.

Thankfully, they provide a solution there as well, which is to slightly refine the condition to !cancelled(), and that's what I've implemented here.

xref: actions/cache#1416

@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot bot commented Oct 6, 2025

Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@cpcloud
Copy link
Copy Markdown
Contributor Author

cpcloud commented Oct 6, 2025

/ok to test

@cpcloud cpcloud requested review from leofang and rwgk October 6, 2025 16:12
@github-actions

This comment has been minimized.

@cpcloud cpcloud enabled auto-merge (squash) October 6, 2025 16:41
@cpcloud cpcloud merged commit b2ad654 into NVIDIA:main Oct 6, 2025
71 checks passed
@cpcloud cpcloud deleted the replace-always-with-not-cancelled branch October 6, 2025 16:47
@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 6, 2025

Doc Preview CI
Preview removed because the pull request was closed or merged.

@leofang leofang added bug Something isn't working P0 High priority - Must do! CI/CD CI/CD infrastructure labels Oct 6, 2025
@leofang leofang added this to the cuda.core beta 7 milestone Oct 6, 2025
@cpcloud cpcloud mentioned this pull request Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working CI/CD CI/CD infrastructure P0 High priority - Must do!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants