Title: Decision and proposal records are written non-atomically, and a run killed midway can be approved again · Issue #217 · cloudfall-dev/cloudfall · GitHub
Open Graph Title: Decision and proposal records are written non-atomically, and a run killed midway can be approved again · Issue #217 · cloudfall-dev/cloudfall
X Title: Decision and proposal records are written non-atomically, and a run killed midway can be approved again · Issue #217 · cloudfall-dev/cloudfall
Description: Problem DecisionStore (sdk/src/cloudfall/decision.py) and ProposalStore (sdk/src/cloudfall/operator.py) write a record with Path.write_text, with no temporary file, no rename and no lock. A crash or a full disk mid-write leaves a truncat...
Open Graph Description: Problem DecisionStore (sdk/src/cloudfall/decision.py) and ProposalStore (sdk/src/cloudfall/operator.py) write a record with Path.write_text, with no temporary file, no rename and no lock. A crash o...
X Description: Problem DecisionStore (sdk/src/cloudfall/decision.py) and ProposalStore (sdk/src/cloudfall/operator.py) write a record with Path.write_text, with no temporary file, no rename and no lock. A crash o...
Opengraph URL: https://github.com/cloudfall-dev/cloudfall/issues/217
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Decision and proposal records are written non-atomically, and a run killed midway can be approved again","articleBody":"## Problem\n\n`DecisionStore` (`sdk/src/cloudfall/decision.py`) and `ProposalStore` (`sdk/src/cloudfall/operator.py`) write a record with `Path.write_text`, with no temporary file, no rename and no lock.\n\n- A crash or a full disk mid-write leaves a truncated JSON file, and the next `list()` fails on it\n- Two processes updating the same record (an operator pass and a person's `approve`) overwrite each other\n- `decision.approve()` writes the approval only after the playbook and its verify step ran. A process killed mid-run leaves the decision `proposed` with no trace that execution started, so it can be approved and run a second time\n- `save()` checks `path.exists()` and then writes, so two proposals with the same id race\n\n## Proposal\n\n- Write through a temporary file in the same directory and `os.replace`, creating new records with `O_EXCL`\n- Take a lock file per store for the read-modify-write of one record\n- Record the approval and a `running` status before the first playbook starts; a record found `running` with no outcome is reported as interrupted and is not approvable again\n- One shared store implementation for decisions and proposals, since the two are near copies\n\nProof: a test that kills the runner mid-execution and then shows `decisions approve` refusing the record; a test that truncates one record and shows the store still listing the others (see the companion issue on unreadable records).\n","author":{"url":"https://github.com/romamo","@type":"Person","name":"romamo"},"datePublished":"2026-11-13T08:19:19Z","url":"https://github.com/cloudfall-dev/cloudfall/issues/217"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:aac35a09-76ec-138c-1b87-76f3475669f7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CCEC:1204FD:2780215:33CFFA7:6B0558DD |
| html-safe-nonce | d20bf063a81c180e0a5890a6b434e30ac7fa2fdc00175838eb6674b2baf9c4ff |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQ0VDOjEyMDRGRDoyNzgwMjE1OjMzQ0ZGQTc6NkIwNTU4REQiLCJ2aXNpdG9yX2lkIjoiODc0NTM4MzQxNDU4NjQ5NzI0NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5127523f355f3e1d5379b68ff4a61d8ffeb8c9168f444311825b120de61ab437 |
| hovercard-subject-tag | issue:6367602387 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/cloudfall-dev/cloudfall/217/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fe6f41a8bb270c51e8df8568087cae28ca3b242936c632c083fefce96c6c4bfe/cloudfall-dev/cloudfall/issues/217 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fe6f41a8bb270c51e8df8568087cae28ca3b242936c632c083fefce96c6c4bfe/cloudfall-dev/cloudfall/issues/217 |
| og:image:alt | Problem DecisionStore (sdk/src/cloudfall/decision.py) and ProposalStore (sdk/src/cloudfall/operator.py) write a record with Path.write_text, with no temporary file, no rename and no lock. A crash o... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | romamo |
| hostname | github.com |
| expected-hostname | github.com |
| None | a79a02b7e7546ea306864e922ed2103ef4c04fac63168e11c2b2d4d816793080 |
| turbo-cache-control | no-preview |
| go-import | github.com/cloudfall-dev/cloudfall git https://github.com/cloudfall-dev/cloudfall.git |
| octolytics-dimension-user_id | 339512759 |
| octolytics-dimension-user_login | cloudfall-dev |
| octolytics-dimension-repository_id | 1360999777 |
| octolytics-dimension-repository_nwo | cloudfall-dev/cloudfall |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1360999777 |
| octolytics-dimension-repository_network_root_nwo | cloudfall-dev/cloudfall |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 10dff83edfd4f3617a7792a152d44991587b434c |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width