René's URL Explorer Experiment


Title: Lock a component's runs on the management host; add lock clear by shipmill-romamo[bot] · Pull Request #261 · cloudfall-dev/cloudfall · GitHub

Open Graph Title: Lock a component's runs on the management host; add lock clear by shipmill-romamo[bot] · Pull Request #261 · cloudfall-dev/cloudfall

X Title: Lock a component's runs on the management host; add lock clear by shipmill-romamo[bot] · Pull Request #261 · cloudfall-dev/cloudfall

Description: Stacked on #256. Plan Serves: G-1 Files: sdk/src/cloudfall/component_lock.py (new), sdk/src/cloudfall/lifecycle_error.py (new, LifecycleError moved out of lifecycle so component_lock can raise it), sdk/src/cloudfall/lifecycle.py, sdk/src/cloudfall/app.py, sdk/src/cloudfall/commands.py, sdk/README.md, sdk/tests/test_component_lock.py (new), changelog.d/221-component-lock.md Order: a test that starts a second deploy (and a restart, a rollback, a build) while a deploy's playbook runs, failing on main because both reach the engine; then the management-host lock (an atomic hard link of a holder record under tmp/locks/, held by a context manager around deploy, rollback, restart and the artifact build); then cloudfall lock clear , which shows the lock and its age and removes it only once a person types the component id at a terminal Proof: sdk/tests/test_component_lock.py (the race test fails on main), sdk/tests/test_lifecycle.py, sdk/tests/test_release_approval.py, the command catalog tests Summary This is the management-host half of #221. The host-side lock (one per component on each target server, taken in deploy/rollback/restart and released in always) is not in this PR, hence Part of #221. The race, reproduced. test_a_second_run_of_the_component_fails_before_any_step starts a second run from inside the first run's playbook step. Before this change the second deploy rendered the inventory and ran deploy.yml while the first was still in it; the same holds for every pair of deploy, rollback, restart and build The lock. component_lock(project, component, action) writes a holder record (component, action, user, host, pid, since, a random token) to a private file and hard-links it to tmp/locks/.json. os.link fails when the name exists, so taking the lock is atomic and the record is whole as soon as it exists. The context manager releases it in finally, so a failed run, an exception or Ctrl-C releases it too, and it removes the file only when the token is its own Where it is held. deploy (from before the artifact check to after the receipt check), rollback, restart and build_release_artifact, so the CLI commands, the MCP tools and migrate all take it. health takes no lock: it only reads A second run exits CONFLICT with component_locked before any step, e.g. component crm-backend is locked by a deploy that roman started on mac (process 4242) at 2026-11-13T10:00:00Z, 12 minutes ago; that process is still running. If no deploy of it is running, a person clears the lock with ``cloudfall lock clear crm-backend```. The context carries holder, ageSecondsandstale(true when the process is gone on this host, null when the lock was taken on another host). A malformed record exitsRECORD_INVALID` cloudfall lock clear (new). It shows the lock with its age and removes it once a person types the component id at a terminal (ctx.attest, as release approve): requires_person, no MCP tool, --yes does not answer it. It refuses a lock whose process still runs on this host (CONFLICT, component_lock_in_use), and a lock taken again since it was shown. With no lock it answers cleared: false, effect noop Nothing clears a lock by age Test notes New sdk/tests/test_component_lock.py: the race for every first run (deploy, rollback, restart) and second run (deploy, rollback, restart, build); release after a failed step and after Ctrl-C for each run; a killed run's lock reported stale with its age and left in place; a lock from another host reported as not known; a malformed record; another component's lock does not hold this one; the CLI's CONFLICT; lock clear at a terminal, off a terminal, mistyped, on a live process's lock, with no lock, and kept off MCP Ran: uv run ruff check ., uv run mypy, ansible-lint (production profile, passed), and uv run pytest on test_component_lock, test_lifecycle, test_app, test_commands, test_project, test_agent_server, test_release_approval, test_deploy_approval, test_migrate_approval, test_operator, test_data_migration, test_data_copy_preflight, test_domains_apply/observe/converge, test_owned_postgresql_converge and engine test_command_health_gate and test_playbook. The full suite is left to CI Not covered The host-side lock, so two controllers (two people's checkouts, or the operator on another machine) are not serialized yet cloudfall-engine artifact build and cloudfall-engine playbook run deploy called directly, and decisions approve / operator approve running a catalog playbook, do not go through the SDK's lifecycle functions and take no lock; the host-side lock is what would cover them Part of #221 🤖 Generated with Claude Code

Open Graph Description: Stacked on #256. Plan Serves: G-1 Files: sdk/src/cloudfall/component_lock.py (new), sdk/src/cloudfall/lifecycle_error.py (new, LifecycleError moved out of lifecycle so component_lock can raise it)...

X Description: Stacked on #256. Plan Serves: G-1 Files: sdk/src/cloudfall/component_lock.py (new), sdk/src/cloudfall/lifecycle_error.py (new, LifecycleError moved out of lifecycle so component_lock can raise it)...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.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:647df643-d07a-ecf3-0752-04ad5890d3e2
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8808:1CD602:19879AB:21AD75F:6B055A4E
html-safe-nonceae008f16aa3a6f9ef2e602e3253af67c15132a55a05577afdb3b4bb23a21a7b4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODA4OjFDRDYwMjoxOTg3OUFCOjIxQUQ3NUY6NkIwNTVBNEUiLCJ2aXNpdG9yX2lkIjoiNzc2NjQxMzQ1NDE3Njc3MDYzOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaccd1c283fae2a6991ae62dc6e2bb6856a4250f59fddbad0e4c441a4066b2f299c
hovercard-subject-tagpull_request:5294596557
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/261/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:altStacked on #256. Plan Serves: G-1 Files: sdk/src/cloudfall/component_lock.py (new), sdk/src/cloudfall/lifecycle_error.py (new, LifecycleError moved out of lifecycle so component_lock can raise it)...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonea79a02b7e7546ea306864e922ed2103ef4c04fac63168e11c2b2d4d816793080
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
release10dff83edfd4f3617a7792a152d44991587b434c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/cloudfall-dev/cloudfall/pull/261/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcloudfall-dev%2Fcloudfall%2Fpull%2F261%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%2F261%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/261/files
Reloadhttps://github.com/cloudfall-dev/cloudfall/pull/261/files
Reloadhttps://github.com/cloudfall-dev/cloudfall/pull/261/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/221-component-lockhttps://github.com/cloudfall-dev/cloudfall/tree/fix/221-component-lock
Conversation 1 https://github.com/cloudfall-dev/cloudfall/pull/261
Commits 2 https://github.com/cloudfall-dev/cloudfall/pull/261/commits
Checks 1 https://github.com/cloudfall-dev/cloudfall/pull/261/checks
Files changed 8 https://github.com/cloudfall-dev/cloudfall/pull/261/files
Lock a component's runs on the management host; add lock clear https://github.com/cloudfall-dev/cloudfall/pull/261/files#top
Show all changes 2 commits https://github.com/cloudfall-dev/cloudfall/pull/261/files
f25c4ca Lock a component's runs on the management host; add lock clear shipmill-romamo[bot] Nov 13, 2026 https://github.com/cloudfall-dev/cloudfall/pull/261/commits/f25c4ca8f3a9270d6fa8f8696c5a863100b3b613
bdbe3f6 Merge branch 'main' into fix/221-component-lock shipmill-romamo[bot] Nov 13, 2026 https://github.com/cloudfall-dev/cloudfall/pull/261/commits/bdbe3f6a43fbd28d5d6ad410fbcd17dde2726f2c
Clear filters https://github.com/cloudfall-dev/cloudfall/pull/261/files
Please reload this pagehttps://github.com/cloudfall-dev/cloudfall/pull/261/files
Please reload this pagehttps://github.com/cloudfall-dev/cloudfall/pull/261/files
221-component-lock.md https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-3be30f7bdb800e13e391bcc496c5ccb2e9d201e3f41204b4d8216b75353b92f7
README.md https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-00ba42324c784ebcf27766700a3924a25e593009a52d5431331d42bef9edd2e9
app.py https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
commands.py https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-e11cc5881f876e11cf81d9bcb39f0fb74710976f27a01a99fb979dfc76c09cc1
component_lock.py https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-bf51dc445edbdccac4365b7e8d6c89de809c4beab3ef73708415ca0a62e9747f
lifecycle.py https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-6593e43e7c2a82c570ff2144303fbc6af72efaf8ff8a4075fcc8733b8d86b4d8
lifecycle_error.py https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-de5f1fb4be2676fe3b8e042eb1e8dd32e399bf726cdc1c8d214d7df0ae1c9d01
test_component_lock.py https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-a6be1994b8d25e771f8917543401999b56bca20a2719ae8c48efb242359cf805
changelog.d/221-component-lock.mdhttps://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-3be30f7bdb800e13e391bcc496c5ccb2e9d201e3f41204b4d8216b75353b92f7
View file https://github.com/cloudfall-dev/cloudfall/blob/bdbe3f6a43fbd28d5d6ad410fbcd17dde2726f2c/changelog.d/221-component-lock.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/cloudfall-dev/cloudfall/pull/261/{{ revealButtonHref }}
sdk/README.mdhttps://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-00ba42324c784ebcf27766700a3924a25e593009a52d5431331d42bef9edd2e9
View file https://github.com/cloudfall-dev/cloudfall/blob/bdbe3f6a43fbd28d5d6ad410fbcd17dde2726f2c/sdk/README.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/cloudfall-dev/cloudfall/pull/261/{{ revealButtonHref }}
https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-00ba42324c784ebcf27766700a3924a25e593009a52d5431331d42bef9edd2e9
https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-00ba42324c784ebcf27766700a3924a25e593009a52d5431331d42bef9edd2e9
sdk/src/cloudfall/app.pyhttps://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
View file https://github.com/cloudfall-dev/cloudfall/blob/bdbe3f6a43fbd28d5d6ad410fbcd17dde2726f2c/sdk/src/cloudfall/app.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/cloudfall-dev/cloudfall/pull/261/{{ revealButtonHref }}
https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-80944e9d32bf3de16b8f897a076d9413719c085027f33cffff3fd7b0358d8763
sdk/src/cloudfall/commands.pyhttps://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-e11cc5881f876e11cf81d9bcb39f0fb74710976f27a01a99fb979dfc76c09cc1
View file https://github.com/cloudfall-dev/cloudfall/blob/bdbe3f6a43fbd28d5d6ad410fbcd17dde2726f2c/sdk/src/cloudfall/commands.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/cloudfall-dev/cloudfall/pull/261/{{ revealButtonHref }}
https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-e11cc5881f876e11cf81d9bcb39f0fb74710976f27a01a99fb979dfc76c09cc1
https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-e11cc5881f876e11cf81d9bcb39f0fb74710976f27a01a99fb979dfc76c09cc1
https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-e11cc5881f876e11cf81d9bcb39f0fb74710976f27a01a99fb979dfc76c09cc1
https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-e11cc5881f876e11cf81d9bcb39f0fb74710976f27a01a99fb979dfc76c09cc1
https://github.com/cloudfall-dev/cloudfall/pull/261/files#diff-e11cc5881f876e11cf81d9bcb39f0fb74710976f27a01a99fb979dfc76c09cc1
Please reload this pagehttps://github.com/cloudfall-dev/cloudfall/pull/261/files
Please reload this pagehttps://github.com/cloudfall-dev/cloudfall/pull/261/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.