René's URL Explorer Experiment


Title: Clear a server's lock only if it still holds the shown token (part of #271) by shipmill-romamo[bot] · Pull Request #280 · cloudfall-dev/cloudfall · GitHub

Open Graph Title: Clear a server's lock only if it still holds the shown token (part of #271) by shipmill-romamo[bot] · Pull Request #280 · cloudfall-dev/cloudfall

X Title: Clear a server's lock only if it still holds the shown token (part of #271) by shipmill-romamo[bot] · Pull Request #280 · cloudfall-dev/cloudfall

Description: Summary Two of the three gaps in cloudfall lock clear that #271 names: Race between read and delete (gap 1). lock.yml read a server's lock in one task and deleted it in another, so a run that took the lock in that SSH round trip had its lock deleted while it ran. The clear is now one command on the server: it matches the shown token in the lock record as a fixed string and removes the file only on a match, in the same sh invocation. The token is passed as a positional argument, never interpolated into the script. A lock taken since is kept and read back, so lock clear exits CONFLICT (component_lock_changed) as before. The take and release task files are untouched. noop with unread servers (gap 2, Q-1). With no lock found and a server it could not reach, lock clear answered noop ("no run held it"). It now exits CONFLICT with the existing component_lock_not_cleared code, unreadServers in the error context, and a message saying the lock there is not known. No schema change: it reuses the outcome clear_server_locks already gives an unreachable server. A component with no lock anywhere, every server read, still answers noop. Not in this PR: gap 3 (check for a terminal before contacting any server). treaty 1.0.0rc38 has no public way to ask whether ctx.attest can prompt without prompting (Prompter.interactive is private; ctx.headless is also true on an SSH terminal without a display). The ways to do it are a new treaty API, or a second prompt before reading the servers. That is left as a decision, so this PR is Part of #271, not Fixes. Plan Serves: quality bar (Q-1) Files: engine/ansible/playbooks/lock.yml, sdk/src/cloudfall/app.py, sdk/src/cloudfall/server_locks.py, sdk/src/cloudfall/commands.py, sdk/README.md, sdk/tests/test_server_locks.py, sdk/tests/test_component_lock.py, changelog.d/271-lock-clear-race.md Order: failing tests first (the clear is one command on the host that compares the token and removes the lock; lock clear with unread servers and no lock found exits CONFLICT, not noop), then lock.yml's compare-and-remove step, then the answer in app.py and its contract text, then the README and the changelog fragment Proof: uv run pytest sdk/tests/test_server_locks.py sdk/tests/test_component_lock.py engine/tests/test_component_hosts.py engine/tests/test_deploy_rollback.py engine/tests/test_release_command.py, ruff, mypy, ansible-lint Test plan New test_the_lock_is_compared_and_removed_in_one_command_on_the_server: fails on main (the lock is removed by an ansible.builtin.file task after a separate slurp), passes here. It is a structural test: the race window is one SSH round trip and cannot be hit deterministically from a test New test_a_token_is_never_run_as_shell (3 cases: $(...), quotes, backticks): the lock is kept, CONFLICT, and no command in the token runs Existing test_a_lock_taken_again_since_it_was_shown_is_kept now exercises the new compare-and-remove step under real ansible-playbook New test_lock_clear_with_unread_servers_does_not_say_nothing_held_it: fails on main (exit 0, noop), passes here; replaces test_lock_clear_without_a_lock_changes_nothing, which asserted that noop New test_lock_clear_without_a_lock_anywhere_changes_nothing: noop still holds when nothing is unread uv run pytest on the files above: 118 passed, plus sdk/tests/test_commands.py and sdk/tests/test_project.py. uv run ruff check ., uv run mypy and ansible-lint (with ANSIBLE_CONFIG=engine/ansible/ansible.cfg, as CI runs it) pass. The full suite is left to CI Not run against a real host: the playbook ran under ansible-playbook with local connections only Part of #271 🤖 Generated with Claude Code

Open Graph Description: Summary Two of the three gaps in cloudfall lock clear that #271 names: Race between read and delete (gap 1). lock.yml read a server's lock in one task and deleted it in another, so a run that ...

X Description: Summary Two of the three gaps in cloudfall lock clear that #271 names: Race between read and delete (gap 1). lock.yml read a server's lock in one task and deleted it in another, so a run t...

Opengraph URL: https://github.com/cloudfall-dev/cloudfall/pull/280

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:5f0afa8f-dd72-fe38-ac4f-ed3fe1338b78
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA5D8:24CE74:1EBF636:296C467:6B055CAE
html-safe-nonce78e50bf1c6803f73903f6c3acc05038d86d9b949dd4caeefe8bec8185a9d5052
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNUQ4OjI0Q0U3NDoxRUJGNjM2OjI5NkM0Njc6NkIwNTVDQUUiLCJ2aXNpdG9yX2lkIjoiNzE5ODgxOTQ1NTY5NzUwOTU1MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaccd783d3f7cb3290f5cf16edf4690c4b333acee2f964a0eb03597460fa9b1ba15
hovercard-subject-tagpull_request:5297086869
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/cloudfall-dev/cloudfall/pull/280/files
twitter:imagehttps://avatars.githubusercontent.com/u/5600783?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/5600783?s=400&v=4
og:image:altSummary Two of the three gaps in cloudfall lock clear that #271 names: Race between read and delete (gap 1). lock.yml read a server's lock in one task and deleted it in another, so a run that ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None8a6760da3cce5e2d079d07e3b62df71194316c4478db1a5e38050f44fce72c72
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/cloudfall-dev/cloudfall git https://github.com/cloudfall-dev/cloudfall.git
octolytics-dimension-user_id339512759
octolytics-dimension-user_logincloudfall-dev
octolytics-dimension-repository_id1360999777
octolytics-dimension-repository_nwocloudfall-dev/cloudfall
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1360999777
octolytics-dimension-repository_network_root_nwocloudfall-dev/cloudfall
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8327739ac0648b9c3c722b5f401f7338553936b8
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/cloudfall-dev/cloudfall/pull/280/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcloudfall-dev%2Fcloudfall%2Fpull%2F280%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcloudfall-dev%2Fcloudfall%2Fpull%2F280%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=cloudfall-dev%2Fcloudfall
Reloadhttps://github.com/cloudfall-dev/cloudfall/pull/280/files
Reloadhttps://github.com/cloudfall-dev/cloudfall/pull/280/files
Reloadhttps://github.com/cloudfall-dev/cloudfall/pull/280/files
cloudfall-devhttps://github.com/cloudfall-dev
cloudfallhttps://github.com/cloudfall-dev/cloudfall
Codehttps://github.com/cloudfall-dev/cloudfall
Issues78 (78)https://github.com/cloudfall-dev/cloudfall/issues
Pull requests10 (10)https://github.com/cloudfall-dev/cloudfall/pulls
Discussionshttps://github.com/cloudfall-dev/cloudfall/discussions
Actionshttps://github.com/cloudfall-dev/cloudfall/actions
Security and qualityhttps://github.com/cloudfall-dev/cloudfall/security
Insightshttps://github.com/cloudfall-dev/cloudfall/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fcloudfall-dev%2Fcloudfall%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fcloudfall-dev%2Fcloudfall%2Fissues%2Fnew%2Fchoose
shipmill-romamohttps://github.com/apps/shipmill-romamo
mainhttps://github.com/cloudfall-dev/cloudfall/tree/main
fix/271-lock-clear-racehttps://github.com/cloudfall-dev/cloudfall/tree/fix/271-lock-clear-race
Conversation 1 https://github.com/cloudfall-dev/cloudfall/pull/280
Commits 1 https://github.com/cloudfall-dev/cloudfall/pull/280/commits
Checks 1 https://github.com/cloudfall-dev/cloudfall/pull/280/checks
Files changed https://github.com/cloudfall-dev/cloudfall/pull/280/files
Please reload this pagehttps://github.com/cloudfall-dev/cloudfall/pull/280/files
Clear a server's lock only if it still holds the shown token (part of #271) https://github.com/cloudfall-dev/cloudfall/pull/280/files#top
Show all changes 1 commit https://github.com/cloudfall-dev/cloudfall/pull/280/files
c0100e4 Clear a server's lock only if it still holds the shown token shipmill-romamo[bot] Nov 13, 2026 https://github.com/cloudfall-dev/cloudfall/pull/280/commits/c0100e48a5877777df6d714c2bc11c608df50295
Clear filters https://github.com/cloudfall-dev/cloudfall/pull/280/files
Please reload this pagehttps://github.com/cloudfall-dev/cloudfall/pull/280/files
Please reload this pagehttps://github.com/cloudfall-dev/cloudfall/pull/280/files
271-lock-clear-race.md https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-74c0a578a22108ec9ad6e858e9406be93da374e72d123854fd185f590b9036ea
lock.yml https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-962980980a790b25067839b531281ae86931167833c35bc883f64eb02ece9cd2
README.md https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-00ba42324c784ebcf27766700a3924a25e593009a52d5431331d42bef9edd2e9
app.py https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
commands.py https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-e11cc5881f876e11cf81d9bcb39f0fb74710976f27a01a99fb979dfc76c09cc1
server_locks.py https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-7f959a0bd50e0e0702edb2528b30c37ba487ebc1b8c17e87905e14df163746a8
test_component_lock.py https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-a6be1994b8d25e771f8917543401999b56bca20a2719ae8c48efb242359cf805
test_server_locks.py https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-cdb06430f9b8e113ae41d30b01976d38b9c9ea1fe1cbf084a08b229b597ba379
changelog.d/271-lock-clear-race.mdhttps://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-74c0a578a22108ec9ad6e858e9406be93da374e72d123854fd185f590b9036ea
View file https://github.com/cloudfall-dev/cloudfall/blob/c0100e48a5877777df6d714c2bc11c608df50295/changelog.d/271-lock-clear-race.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/cloudfall-dev/cloudfall/pull/280/{{ revealButtonHref }}
engine/ansible/playbooks/lock.ymlhttps://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-962980980a790b25067839b531281ae86931167833c35bc883f64eb02ece9cd2
View file https://github.com/cloudfall-dev/cloudfall/blob/c0100e48a5877777df6d714c2bc11c608df50295/engine/ansible/playbooks/lock.yml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/cloudfall-dev/cloudfall/pull/280/{{ revealButtonHref }}
https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-962980980a790b25067839b531281ae86931167833c35bc883f64eb02ece9cd2
https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-962980980a790b25067839b531281ae86931167833c35bc883f64eb02ece9cd2
https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-962980980a790b25067839b531281ae86931167833c35bc883f64eb02ece9cd2
sdk/README.mdhttps://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-00ba42324c784ebcf27766700a3924a25e593009a52d5431331d42bef9edd2e9
View file https://github.com/cloudfall-dev/cloudfall/blob/c0100e48a5877777df6d714c2bc11c608df50295/sdk/README.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/cloudfall-dev/cloudfall/pull/280/{{ revealButtonHref }}
https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-00ba42324c784ebcf27766700a3924a25e593009a52d5431331d42bef9edd2e9
https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-00ba42324c784ebcf27766700a3924a25e593009a52d5431331d42bef9edd2e9
sdk/src/cloudfall/app.pyhttps://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
View file https://github.com/cloudfall-dev/cloudfall/blob/c0100e48a5877777df6d714c2bc11c608df50295/sdk/src/cloudfall/app.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/cloudfall-dev/cloudfall/pull/280/{{ revealButtonHref }}
https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
sdk/src/cloudfall/commands.pyhttps://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-e11cc5881f876e11cf81d9bcb39f0fb74710976f27a01a99fb979dfc76c09cc1
View file https://github.com/cloudfall-dev/cloudfall/blob/c0100e48a5877777df6d714c2bc11c608df50295/sdk/src/cloudfall/commands.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/cloudfall-dev/cloudfall/pull/280/{{ revealButtonHref }}
https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-e11cc5881f876e11cf81d9bcb39f0fb74710976f27a01a99fb979dfc76c09cc1
https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-e11cc5881f876e11cf81d9bcb39f0fb74710976f27a01a99fb979dfc76c09cc1
sdk/src/cloudfall/server_locks.pyhttps://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-7f959a0bd50e0e0702edb2528b30c37ba487ebc1b8c17e87905e14df163746a8
View file https://github.com/cloudfall-dev/cloudfall/blob/c0100e48a5877777df6d714c2bc11c608df50295/sdk/src/cloudfall/server_locks.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/cloudfall-dev/cloudfall/pull/280/{{ revealButtonHref }}
https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-7f959a0bd50e0e0702edb2528b30c37ba487ebc1b8c17e87905e14df163746a8
https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-7f959a0bd50e0e0702edb2528b30c37ba487ebc1b8c17e87905e14df163746a8
sdk/tests/test_component_lock.pyhttps://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-a6be1994b8d25e771f8917543401999b56bca20a2719ae8c48efb242359cf805
View file https://github.com/cloudfall-dev/cloudfall/blob/c0100e48a5877777df6d714c2bc11c608df50295/sdk/tests/test_component_lock.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/cloudfall-dev/cloudfall/pull/280/{{ revealButtonHref }}
https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-a6be1994b8d25e771f8917543401999b56bca20a2719ae8c48efb242359cf805
https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-a6be1994b8d25e771f8917543401999b56bca20a2719ae8c48efb242359cf805
https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-a6be1994b8d25e771f8917543401999b56bca20a2719ae8c48efb242359cf805
https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-a6be1994b8d25e771f8917543401999b56bca20a2719ae8c48efb242359cf805
sdk/tests/test_server_locks.pyhttps://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-cdb06430f9b8e113ae41d30b01976d38b9c9ea1fe1cbf084a08b229b597ba379
View file https://github.com/cloudfall-dev/cloudfall/blob/c0100e48a5877777df6d714c2bc11c608df50295/sdk/tests/test_server_locks.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/cloudfall-dev/cloudfall/pull/280/{{ revealButtonHref }}
https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-cdb06430f9b8e113ae41d30b01976d38b9c9ea1fe1cbf084a08b229b597ba379
https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-cdb06430f9b8e113ae41d30b01976d38b9c9ea1fe1cbf084a08b229b597ba379
https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-cdb06430f9b8e113ae41d30b01976d38b9c9ea1fe1cbf084a08b229b597ba379
https://github.com/cloudfall-dev/cloudfall/pull/280/files#diff-cdb06430f9b8e113ae41d30b01976d38b9c9ea1fe1cbf084a08b229b597ba379
Please reload this pagehttps://github.com/cloudfall-dev/cloudfall/pull/280/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.