Repository navigation
fix(apps): each app's operations go through one manager, one at a time - #1922
Conversation
59308c7 to
355eb9d
Compare
f45365f to
f4db86b
Compare
Cabecinha84
left a comment
There was a problem hiding this comment.
Review at head f4db86b (1st pass): request changes (small)
Reviewed against current development (396cc10); merge-base is the dev tip, so no rebase needed. The design is sound. Two defects need fixing before this can merge.
Must fix
1. A soft redeploy can delete the app's syncthing folder.
Dev skipped the whole syncthing monitor pass while any install, removal or redeploy ran (node-wide flags). Those flags are gone here. Held apps are skipped for processing and writing, but not exempted from the unused-folder deletion in syncthingMonitor.js (~l.936), which works from installed-app rows only. softRemoveAppLocally deletes the row but not the folder, so until the reinstall writes the row back, a pass that read rows in that gap deletes the folder. The window is seconds, longer if admissions are contended.
- Probe: held app with a folder and no row,
adjustConfigFolders('delete', undefined, id)is called. - Impact: the folder's syncthing index, peer devices and promotion/demotion state are lost. Data loss beyond that is unverified.
- Hard redeploy, install and component redeploy are not affected.
- Fix: exempt the folders of held apps from
nonUsedFolders, with a test (held app, no row, folder kept).
2. A redeploy's requirements check counts the app's own reservation.
softRedeployApp reserves the app's footprint (reserveForRedeploy), tears it down, then calls appInstaller.checkAppRequirements(appSpecs) (advancedWorkflows.js:1670) without { replacing: appSpecs.name }. appsResources() only drops the app's own reservation when excludeApp is passed, so the reservation plus the new requirement counts the app twice.
- Reproduced with the real
admissionControl,operationRegistryandhwRequirements: on a node with room for exactly one copy, the plain check rejects and thereplacingcheck passes. - Same defect in
appRebuild.js:38(hard redeploy, the v3→v4 / v8 update paths, soft→hard escalation); all of them reserve first under the same operation. - The failure comes after the app is already removed, and goes to the forced, network-broadcast uninstall. The app and its data are lost on any node where the new spec fits only once.
- Fix: pass
{ replacing: appSpecs.name }at both sites, with a test on a one-copy node. The other call sites (1875, 2019, 4661, and the install path viaadmitApp) already pass it.
Should fix / sign-off
residentialNodeDosServicechecks onlylistByType('install'). A redeploy's reinstall is aparentstep, so the lease type staysredeploy; a single-app node can be put into DOS mid-redeploy (dev'sinstallationInProgresscovered it).nodeStatusMonitoralready unions both types.FluxPeerManager.broadcastdrops the 500 ms outbound→inbound gap for every relay, not only the announcements. This is a network-wide behaviour change and needs an explicit sign-off.- A test install and a real install of the same app coalesce in
submit(both typeinstall). - No timed release: a hung holder blocks its app until restart (narrower than dev's node-wide flags).
recreateMissingstill runs outside a lease (as on dev). docs/syncthing-health-monitor.mdstill mentions the removed flags.- Carried from #1921: the heal-clear race and the
r:first-run policy sign-off. #1921 must merge first (this PR is based on its branch).
Verified OK
- Every operation-nested remove/install/redeploy call passes
parent(no self-deadlock); backup and restore release their lease on every exit; an owner start during a restore is now refused (closes the open #1921 item); no uses of the removed flags remain in code. - Unit suite on a clean run: 13523 passing, 0 failing, 2 pending. eslint clean on all changed files. CI green.
Conditions for ACK
- Both must-fix items, each with a test.
- Harness gate at the new head. The body's 334/334 is at
355eb9d36d, which is no longer in the PR (looks like a pre-rebase hash); the body's unit count (13,450) is also stale. - #1921 merged first.
- Sign-off on, or a fix for, the residential DOS check and the broadcast gap.
|
Thanks for the review. Each item, at head Must fix 1: a soft redeploy can delete the app's syncthing folder. Fixed at the cause, in a different shape from the one suggested ( Must fix 2: a redeploy counts the app twice. Fixed on both paths. The soft redeploy checks with Residential DOS mid-redeploy. Fixed ( The broadcast gap: sign-off. Signed off: it stays removed. Since 8.24.0 a node announces a message and each peer fetches it from one announcer ( A test install and a real install coalesce. A test install is no longer an install. No timed release. Kept by design: a hold lasts exactly as long as its operation. A timed release would let the hung operation carry on beside the next one, the overlap the manager exists to prevent. A hang is now contained where it starts: every short docker request carries a deadline (
Carried from #1921. Both on this PR: the heal is an operation on the app ( Also on this PR. The give-up pass's hand-back is an operation on the app, so the copy it proved is the copy it removes, at the turn it decided on ( Conditions. Both must-fixes have tests. Unit suite at this head: 13,585 passing, 0 failing, 2 pending; the body is updated. #1921 merges first. Gate. The full gate at |
Cabecinha84
left a comment
There was a problem hiding this comment.
Review at head f3e9567715 (2nd pass)
Verdict: request changes (small). Both of my earlier must-fixes are fixed. Two new findings are traced end to end, and the test run needs confinement. #1921 must merge first.
Basis. The head sits directly on current development (396cc107b, merge-base == tip), so the tree is the merged result. On a clean worktree: unit 13592 passing / 0 failing / 2 pending, eslint clean on all 116 changed JS files, CI green. The 336/336 harness gate at this head is the author's claim; I have not re-run it.
Earlier must-fixes: fixed
- Held app's syncthing folder deleted mid-redeploy: fixed at the cause. The soft redeploy keeps the row, and I found no path left (soft, hard, component, composed update) that leaves a held app with a folder but no row.
- Redeploy counting the app twice:
{ replacing }is now passed on the soft path, inappRebuildand at the other call sites. - Residential DOS mid-redeploy: fixed via
listArriving().
Must change before ACK
1. A failed composed-app update repeats its teardown on every pass (advancedWorkflows.js ~l.4383-4426).
The loop tears components down first, including hardUninstallComponent, which deletes data for components whose hdd changed. Only then does checkAppRequirements({ replacing }) run. If it throws, the row still holds the old spec (the catch comment "the row holds the new specification" is wrong), the app is handed to the reconciler at the old spec, and the hash still mismatches. On development this failure removed the app; now reinstallOldApplications re-runs the teardown every pass.
Fix: run the check before the teardown loop, as softRedeployApp and rebuildApp already do, and correct the comment.
2. A slow docker daemon can get an app uninstalled by the reconciler (appReconciler.js:566).
After a failed recreate, getDockerContainerOnly(identifier).catch(() => undefined) reads a timed-out list (new 20 s deadline) as "container absent". That records recreation_failed and, for a component that never ran, calls removeAppLocally. Before this PR a stuck docker call hung forever, so this branch was unreachable; the new deadlines make it reachable.
Fix: treat AbortError like the database-error case (retry, do not remove).
3. The test run is unconfined, and its cleanup can delete an image a real install needs (appTestRun.js).
- Test containers have no
CgroupParent(outsideflux.slice), no disk limit (plain directories, noStorageOpt), and no admission reservation, so real installs can be admitted on top of a test run. - The cleanup removes images the run pulled. A real install of the same app that is still in volume creation (no container yet) can lose its image; the old
operationHoldingguard is gone. - A non-404 image-removal error aborts the sweep, and a half-written
pulled.json(written in place) throws aSyntaxErrorout ofreadPulled; in both cases every later sweep and test run fails until someone intervenes.
Should-fix (non-blocking)
- A docker remove that times out is never recorded in
fluxRemovedContainers; if docker finishes it late, the reconciler logscontainer_vanished. - A v1
fluxappremovedcarrying an extraapps:"x"field breaks theregistryManager.js:597aggregation (reproduced the$inerror on local mongo), scoped to that signer's address. fluxappremovedv2: no byte cap or name validation, and the sender does not split lists overmaxAppsPerNode(200). One failed send also fails a whole v1 batch.- A failed geolocation lookup after an IP move is still recorded as geolocated (
fluxNetworkHelper.js~l.2294, pre-existing, but the spawner restart now relies on it).
Maintainer sign-offs (policy, not bugs)
- A bad new spec leaves the app kept down indefinitely (retry ladder capped at 30 min), still announced to the network and holding resources.
- The Orbit health check is dropped from test runs, and
/apps/testappinstallnow returns different text and takes at least 60 s. External consumers (UI, FluxCloud, Deploy with Git) are not verified. - Restart policy
nohas a first-boot window on nodes that never booted 8.13+; rare. - No timed release (kept by design); the broadcast-gap removal is already signed off by the author.
fluxappremovedv2: readers ship in 8.24.0 and sending is gated at 8.25.0, so the gate is safe; the comment calling 8.25.0 the first reader is wrong.
Checked and fine
No caller of a removal without a response stream assumes the app is gone after PENDING; no unhandled-rejection path; no submitted operation can fail to settle; spawnerControl has a start for every stop and releases its lock on every install exit; the boot sweep cannot match a real container, network or directory; docker 404 error shapes are preserved; no references to the deleted containerMountRecovery remain.
With items 1-3 fixed I would ACK, subject to the sign-offs above, #1921 merging first, and a full gate re-run at the final head.
|
Thanks for the second pass. Each item: Must 1: a failed composed update repeating its teardown. Fixed ( Must 2: a slow docker daemon and the reconciler's removal. No change. The branch is reached only for a component that has never run here (a fresh install whose container vanished before its first 60 s), so no data of the owner's is at stake, and its removal lets the network place it on a node that can run it. Must 3: the test run. Reworked, as the interim it is until v9's playground replaces it, the Orbit check included:
Harness: 3507 (held at a new Should 1: a removal that times out is not recorded as FluxOS's. Fixed ( Should 2: a v1 Should 3: Should 4: a failed geolocation lookup after an IP move recorded as geolocated. Fixed ( Sign-offs.
Gate. Full gate on tester at |
Cabecinha84
left a comment
There was a problem hiding this comment.
Review, 3rd pass, at head ebd35671b
Verdict: code ACK, with the conditions below. My earlier requested changes are resolved except for one new gap (1).
Checked on the merged tree (merge-base is the current development tip 396cc107b):
- Unit suite: 13,649 passing, 0 failing, 2 pending. eslint exits 0 on all 123 changed
.jsfiles. CI is green. - The harness gate (341/341 at
aa6bd4cb4) is the author's run. I did not re-run it.
Resolved since my last pass
- An update is now checked before any component comes down, in the update pass and in the owner's soft and hard redeploy of one component. A declined update publishes
app:updateDeclined. - Test run: 0.2 CPU and 300 MB under
flux.slice, the Orbit build check is back, and its sweep touches only its own containers, networks and directories. - Image reaper: the "nothing is building" check and the removal are one synchronous step, and installs, redeploys and rebuilds all hold their app, so I found no race. FluxOS's own file-operation image is kept.
removedByFluxOsis recorded durably before docker is asked. The network-heal removal has its own flag and is routed beforerecreateMissing. The other direct docker-remove callers are file-operation containers and test runs.- Strict
fluxapprunningandfluxappremovedshapes: I diffed the senders at v8.22.0, v8.23.1 and v8.24.0, and they send exactly those fields. ThemaxAppsPerNodecap already existed. The boot cleanup touches only those two event types. - Geolocation after an IP move: a move is settled only once the geolocation held is for the new IP.
Conditions
- A declined update for a static-IP requirement leaves the app running its old spec forever.
- When
checkAppRequirementsthrows in the composed update path,reinstallOldApplicationnow returns early. The give-up pass only hands back for hardware (OUTGROWN) and geolocation (MISPLACED). - So an update that turns on
staticip, on a node that can't meet it, leaves the app running the old spec and announced with the old hash. It declines again every pass, and nothing subscribes toapp:updateDeclined.developmentremoved the app in this case. - The
nodes-pin case is fine, becausemayTearDownToRebuildremoves the app first. - Please either make the give-up pass treat this like OUTGROWN, or state in the PR that these apps stay by design.
- When
- Merge #1921 first. It is still the base and is open.
- Run the harness gate at the final head. It is one test-only commit behind the author's run.
Non-blocking
appReconciler.recreateMissing:getDockerContainerOnly().catch(() => undefined)still reads a timed-out docker list as "container absent". It only matters for a component that never ran. TreatingAbortErrorlike a database error would be a one-line fix.recreateMissingremoves the whole app when a never-started component fails to recreate, including siblings that have run and hold data.developmentdoes the same, so this PR makes it less likely. Checking the siblings'hasSuccessfullyStartedfirst would close it, and it sits awkwardly with "no failed update removes an app that has run here".pruneUnusedImagesnow removes every unreferenced tagged image on the host, not just dangling ones. It runs at boot, every 720 blocks and after each test run. That is operator-visible, so it belongs in the release notes.located?.ip === ipneeds the node's egress IP to equal its advertised IP. If they differ, the move never settles and the spawner stays stopped.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## fix/backup-restore-run-authority #1922 +/- ##
===================================================================
Coverage ? 86.29%
===================================================================
Files ? 291
Lines ? 42626
Branches ? 0
===================================================================
Hits ? 36782
Misses ? 5843
Partials ? 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks for the third pass. Each item: Condition 1: an update asking for a static IP leaves the app on its old specification. Fixed ( A legacy app's heal lease key (from #1921's fifth pass). Fixed (
Since your pass: what the gate found. The full gate at Gate. Full gate on tester at |
Cabecinha84
left a comment
There was a problem hiding this comment.
ACK (code) at head 7dd83d813, conditional on the items below.
Checked against current development (396cc107b is the merge-base, so the PR tree is the merged result; MERGEABLE/CLEAN, CI green). Unit suite on that tree: 13668 passing / 0 failing / 2 pending, eslint clean on the changed files. I also ran 16 mutations against the delta since my last pass; the new tests catch all but the two noted below.
Prior items, verified fixed in code
- Static-IP / data-centre update no longer leaves the app on its old spec on a definite answer:
UNSUITEDhand-back vianodeKindShortfall(fires only on DYNAMIC / RESIDENTIAL). - Legacy v1-3 heal lease key now uses
getBaseAppName, the key restore and backup take. recreateMissingremoves an app only when no component has run here; runtime state is cleared on removal, so a failed fresh install is still removed; an unreadable spec retries.sendRemovalrecords the node's own removal (event log + own location row) before sending; DB errors propagate, so an unrecordable removal is kept as before.
Conditions before merge
- Merge #1921 first (still open as base at
577ab690e); they have to ship in the same release. - Post the full gate at
7dd83d813. The last full run was 339/342 at10ac77743, and605e8974b(production code) came after it.
Sign-offs / non-blocking
- A static-IP state that stays UNKNOWN (a NAT node whose address rotates more often than every 10 days, or an unreadable egress interface) still declines a static-IP update and never hands the app back. Narrower than before, and dev removed the app, but not fully closed.
- No update-time
datacentercheck exists (appInstaller.checkAppRequirementsnever calls it), and the give-up pass reads the published table while installs use the node's own reading, so the outcome there depends on timing. sendRemovaldeletes the node's own row beforesendToAll: if a v2 batch fails midway,keepRemovalfinds no row and keeps nothing. Not reachable through the send step today.- Test gap: removing
UNSUITEDfromHANDED_BACKor fromstillLeavingis not caught (theOUTGROWNequivalents survive too, so this predates the PR). - Still open from earlier passes: the docker lookup timeout in
recreateMissingread as "absent" (declined), unconditionalreleaseHold, and thepruneUnusedImageshost-wide behaviour (operator-visible, in the release notes).
…restore, a redeploy waits for it A backup and a restore of an app claimed separate lists, and nothing on the removal or redeploy paths read the backup's: an app could be removed, redeployed or restored while its backup ran, and a backup deletes the previous archive before it writes the next. operationRegistry holds one lease per app for a backup, a restore, a removal or a redeploy (v9's shape, without a timed release). A backup or restore is refused while anything holds the app. A removal asks a backup or restore holding it to stop, and waits for its release: the job stops at its next step (the archive, unpack and download take its signal), lifts its hold and releases the app. A redeploy waits for a backup or restore to end. No caller of a removal or redeploy is refused, so none loses one. globalState's backup and restore lists are views of the registry. The removal publishes app:operationPreempted and the redeploy's wait app:operationWaiting; a backup holds at backup:beforeArchive. Tests: unit tests for the registry and each rule, each red under its mutation (removal without the stop request, removal without the wait, redeploy without the wait, backup without its step check, the claim not exclusive). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A restore asked for during a backup is refused and the backup finishes whole; a redeploy asked for during a backup runs once it has finished; a removal stops a backup, and stops a restore before it clears the data. Mutations (tester), each red at its own case: the claim not exclusive at the refused restore; the redeploy not waiting at the waiting redeploy; the removal not asking the job to stop at both removal cases; the restore not stopping before its clear at the restore case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…re they check them Each rebuild test built the record's five indexes, most of its time and the part that slows with load, and only one test reads them. The tests of what the record holds run without the build; "carries the record's indexes" keeps it, and is red with the build removed from rebuild. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The growth is made in the Content-Length header call, so it always lands after the length is measured; appended concurrently, it could land before, and the test then measured nothing. Red with the send not capped at the declared length. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ase that does not wait Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
operationRegistry.run(app, type, fn, { parent }) takes the app for an
install, removal, redeploy, backup, restore or owner action, runs it and
releases the app when it settles, on every exit. When another operation
holds the app, the arriving one's rule decides: a removal stops the
holder at its next step and runs once it is released; a second removal,
pending or running, gets the first's outcome; a backup, restore or owner
action is refused; a redeploy or install runs once the holder is
released, and is refused while a removal is pending or running. A step
of an operation runs under it, named as its parent. Nothing is released
on a timer.
Tests: a unit test per rule; each rule broken alone is red at its own
tests (no preempt, no join, no refusal while a removal is pending, no
re-check after a wait, owner actions waiting, a step under any parent,
a step ignoring its parent's stop, no release on a throw, a check
separated from the take). Unit suite 13,494 passing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
operationRegistry.submit(app, type, fn, { parent }) sends an operation to
the app's manager, which runs them one at a time. A redeploy or install
the app cannot take now waits in the app's manager, not in its caller,
and a later one of the same type replaces it, every caller getting the
outcome of the one that ran; so a caller looping over apps sends and
moves on. A removal refuses what is waiting and runs next. A backup,
restore or owner action is taken now or refused. Releasing a lease
starts the app's next operation.
Tests: each rule broken alone is red at its own tests (no preempt, no
join, no refusal while a removal is pending, a removal keeping what
waits, no coalescing, owner actions waiting, a release starting nothing,
a step under any parent, a step ignoring its parent's stop, no release
on a throw, the take after an await).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without it each of these tests threw on the first line of the removal and passed on the error it wrote to the response, so a test named for removing an app removed nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A removal is sent to its app's manager: it stops the app's running operation at its next step, refuses what waits, and runs next. Two removals of one target run once, the second answered with the first's outcome and telling the network itself when the first did not; a removal of the whole app waits for a removal of one component, never joining it. `force` skips the node's guards and never the app's manager. A redeploy runs through the manager as well, and its removal and install steps (rebuildApp, the install cores and their cleanup removals, mayTearDownToRebuild) run under it as its parent. A redeploy the app cannot take waits in the manager; a caller going through apps in turn - the reinstall pass, the image update check, the storage inspector, volume validation - sends it with wait: false, so a busy app is refused and left for that caller's next round instead of holding the apps after it. The reinstall pass runs each app's update as that app's redeploy. Tests: unit tests for each wiring rule, each red under its mutation (no join, a joiner never or always telling the network, the pass waiting, the pass's rebuild and removal not steps, a redeploy ignoring wait, the image update check, inspector and volume validation waiting); the registry's target and wait rules each red alone. Unit suite 13,509 passing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…step Its install's cleanup removal ran as a removal of its own, which stops the redeploy holding the app and waits for it while the redeploy waits for the install. The install is a step of the redeploy, named as its parent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ps one mid-pull registerAppLocally sends the install to the app's manager: it runs now when the app is free, or once the operation holding it ends; refused there it is BUSY, touching nothing. The spawner sends with wait: false, so an app another operation holds never stalls it. An install stops when its operation is stopped: before its pull, its volume, its container and its start, and the pull itself, whose transfer a caller's signal now aborts as a stall does. An install a removal stopped tells no installing error and removes nothing - the removal that stopped it takes the app down and tells the network. The reinstall pass's direct installs take its redeploy's signal. Tests: each rule red under its mutation (the pull ignoring a signal or one already aborted, no check before the pull, a stopped install telling an error or cleaning up, in both install cores, the install bypassing the manager, the spawner waiting, the pass's install without its signal). Unit suite 13,518 passing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ation holds the app An owner action is an action taken now: it runs as an operation of the app's manager and is refused while an install, removal, redeploy, backup or restore holds the app, never queued as intent for afterwards. A start during a restore no longer clears the record of a component the restore is still replacing; the owner starts it once the restore has ended. The run-state and target doc comments sit on the functions they describe. Tests: each action - start, stop, restart, kill, restart of what runs - refused while a restore holds the app, writing no lock and clearing no record; red with the actions outside the manager, and red alone with only the restart of what runs outside it. Unit suite 13,524 passing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ses a removal naming no app's name 3501: a removal naming an app by a name no app may have is refused, and a correct one after it is taken. state-events.specHashOf gives each fixture app a specification hash of 64 hex. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A removal is exactly its version's fields: one carrying fields that read as expressions is refused whole, and a well-formed one is stored as signed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A move's geolocation is taken as found only when what the geolocation service holds is for the move's new IP: the lookup reports no failure of its own, so a failed one leaves the node holding its old address's geolocation. Until it is found the move is not settled, and a later pass asks again. The spawner is stopped while a move has apps or a geolocation to handle, between the move's passes as well as during them (spawnerControl.setMoveDue), and starts again once both are handled. setMoveDue replaces duringMove. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ere it is Neither geolocation service can locate the node's new IP (the external stub's geolocation can be staged unavailable): the move is not taken as located, the spawner runs no pass across a whole gap between the move's passes, and runs again once a service answers and the node is located. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A test run is its own unit (appTestRun.test.js). An installer test that reached the real one ran its commands on the machine running the tests: it made the test run's directory as root beside the apps folder, which left the folder above it root's and failed the tests that create the apps folder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A v1-3 app's folder id is its docker name (flux<app>), so the heal's lease was taken under a name no backup or restore uses, and the two did not exclude each other. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d back An update that asks for a static IP or a data centre this node is not was declined on every pass and the app kept its old specification here for good. The give-up pass hands it back in turn as UNSUITED, on a definite answer only: a node behind NAT, or one the published table classes as residential. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…for a static IP Solo on tester: 2/2 green. Before-state (product at 9fec975): red at "the node behind NAT gives the app up as UNSUITED, in its turn" (condition not reached in 179 blocks); the static nodes' test stays green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… it has run here Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ng it A peer records a fluxappremoved in its event log and deletes the sender's location row of the app. The sender now does both to itself, between signing and sending: its own row no longer outlives the removal, and a peer that links to it later is given the removal with the announcement it cancels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n any node On a two-node fleet, so the placing node is never sent its own removal back, the placing node is held with the app's record and no containers until it has announced the app. Once the install fails, the peer and the placing node itself hold no row of it, read once as the peer publishes the removal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y, not dockerd Listing a container reads its image from the frozen data root, so a docker ps held by the freeze answered nothing and read as the container gone. The container's directory under the data root is read from the filesystem, which the freeze does not hold, and a read that fails fails the canary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…S is down 3006 cleared the router's table and took its start time before killing FluxOS, so a mapping the old process sent in its last moments counted as the new one's boot mapping. FluxOS is now killed and held down, the table cleared, and FluxOS released. The UPnP stub logs each request it answers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…'s directory 2009 froze docker's whole data root before FluxOS sent the removal, so the removal's lookup could hang on the image store and FluxOS gave up before docker had the removal at all. A node booted with freezableContainerRoot keeps docker's container directories on a filesystem of their own: frozen, the lookup answers, docker takes the removal and holds it at its first write of the container's state, and a removal docker has taken finishes once thawed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… filter 2261 counted every spawner pass over the app from zero and required none before the removal was held, which held only while the node kept its own location row of the app until it expired. The node deletes that row when it announces the removal, before its teardown. The suite now counts the passes the departing filter makes once the removal is held, and asserts no pass found the app a candidate from the removal's start to its release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ress moved A node with no public address on an interface is never static, however long its address is held, but a watched change was asked first and labelled it UNKNOWN for ten days after every move. A NAT node whose address changes more often than that was never DYNAMIC, so an update asking for a static IP was declined on every pass and never handed back as UNSUITED. NAT is asked first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the give-up pass reads An update's requirements never read datacenter, so an update turning it on was applied on a node the published table classes residential, and the give-up pass, which judges only an update not applied, never handed the app back. The update's requirements now read dataCenterShortfall, the rule the give-up pass reads: the update is not applied where the table classes the node residential, and the app is handed back as UNSUITED in its turn. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… for a data centre On the residential fleet, whose published table classes two nodes residential and one hosting, an update turning on datacenter is handed back as UNSUITED by a residential node in its turn, and the hosting node takes the update and keeps the app. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a static-IP update The node behind NAT moves while down and starts at its new address, records watching it change, and reads its static IP as DYNAMIC inside the window the move opened; an update asking for a static IP is then handed back as UNSUITED in its turn. waitForOwnGeolocation waits for a node's own geolocation record at an address. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… first and stays down The stand-down tests ran for EVACUATION only, so dropping OUTGROWN or UNSUITED from the handed-back reasons, or from what keeps a node leaving, went uncaught. For each, a primary of a g: app stops its component instead of being removed, keeps it stopped while the reason holds, and stands for election again once it does not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The syncthing state a failure dumps carries the daemon's running totals of time spent in its database, its filesystem calls and its pulls, from its metrics endpoint, so a slow sync shows where its time went. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s time series run-parallel records the box's disks' extended statistics every 5 s, flushes included, as cap-io.log beside the other captures, ended with the driver. A node running its own syncthing records the daemon's time totals every 15 s through a unit that lives with its container, and a failed suite's dump carries the series as node-NN-syncthing-metrics.log. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…is built A peer the admission quorum asks refuses an app message while its registry is unbuilt, so suite 08's first registration, sent seconds after boot, was refused by a peer that was still building. The orchestrator's harness snapshot reports dbReady; bootAndPeer, once blocks flow, waits for it on every node not running a release image, and suite 08, which boots by hand, waits for it too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…old the registration The holder's bulk catch-up was meant to bring it Bob's registration, but its hash sync could run between the block paying it and its peers storing it: the bulk fetch then lacked it, and the holder asked for it alone, where its door refuses it. A hash sync now passes hashSync:beforeSelect before choosing what to fetch; 2106 holds the holder there while Bob's registration is paid and stored by every other node, then puts the holder behind and releases it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
78f338d to
38017e3
Compare
|
Thanks for the ACK. The four notes, and what else changed since A static-IP state that stays UNKNOWN. Fixed ( No update-time
Removing UNSUITED (or OUTGROWN) from the handed-back reasons or from what keeps a node leaving was not caught. Fixed ( Harness, since your pass. The gate at
Gate. Full gate on tester at |
Stacked on #1921: it builds on the restore record and the operation hold that PR adds, and lands in the same release.
Why
Each kind of operation guarded an app its own way: node-wide flags, a per-app lease only some operations took, and a
forcethat skipped the flags. So operations on one app collided, and an operation on one app stalled every other app:What changes
operationRegistry.submit), which runs them one at a time and releases the app when each ends, on every exit. Nothing is released on a timer:PENDINGwhile an operation other than a removal holds the app; the removal stays sent, runs once the app is free, and one asked meanwhile joins it. A removal streaming to a caller waits for its outcome.dockerProbeTimeoutMs(20 s); a stop its own SIGKILL wait plusdockerStopSlackMs(30 s); a restart a stop and a start; every other short requestdockerRequestTimeoutMs(120 s). A request past its deadline is cancelled and fails as any failed request does. dockerode's network and image inspects pass no signal on, so those reads go through docker-modem. Streams, transfers, sized reads, disk usage and the image prune carry none; a pull keeps its stall abort.spawnerControl) while the node is ready and no move of its address is being worked through. Losing readiness, or a move whose apps or geolocation are still to be handled, stops it: every attempt in flight is marked stopped at once and checks its own mark at its waits and its install, so an attempt busy elsewhere when the stop came installs nothing; an attempt stopped that way withdraws its installing claim and is not held against the app, and one stopped after its own install keeps the app's mark. An install of an app from any other route stops an attempt still deciding on that app, which neither takes the app nor marks it failed, and the spawner decides afresh. Its install starts under the controller's lock, held until the node records the app: a stop that comes first installs nothing, and one that comes later finds the app among the node's apps without waiting for the install to finish. A move handles the node's apps once the spawner has stopped, an app being installed among them (its operation runs after the install). The spawner stays stopped while the move has apps to handle or a geolocation to find, between the move's passes as well as during them (setMoveDue), and starts again once both are handled; the move is taken as located only when the geolocation held is for its new IP. It counts the apps a node holds, running or not, againstmaxAppsPerNode.staticipon a node behind NAT, or a v8+ spec withdatacenteron a node the published table classes residential (dataCenterShortfall), is handed back in turn (UNSUITED), as OUTGROWN is. An update's requirements read the same data-centre rule, so an update turning ondatacenteris not applied where the table classes the node residential, and is handed back. Only a definite answer hands back: an interface that cannot be read, a conflicted or missing classification, or a spec that cannot be read keeps the app. The give-up reasons are one frozen enum (GiveUpReason).app:updateDeclined).hasSuccessfullyStarted, a run that lastsfirstRunProofMs) is kept, the failed component down and its recreate retried on the restart ladder; an app none of whose components has run here is a failed install and is removed. An installed spec or runtime record that cannot be read removes nothing. A component that fails to install removes nothing from its app.app:operationEnded), and starts nothing of an app whose removal is pending. No pass over every app stands aside for the node. The syncthing health monitor skips only the folders of an app an operation holds./apps/testappinstallstarts the app's containers, each at a fixed 0.2 CPU and 300 MB underflux.slice, judges each as soon as it starts and removes everything at once: an exited container fails with its exit code and last log lines; arunonflux/orbit(Deploy with Git) container is passed on its build check (/api/status, every 5 s, up to 2 minutes), reached at its address on the run's network; any other passes on starting. It takes no operation slot, writes no row, opens no host port and creates no syncthing folder; the passing line is development's. A boot sweep removes what a run left (its containers, networks and directories) before the next run starts. The test run is interim: v9 removes it in favour of the playground.imageReaper): only when no container references it (running or stopped, by reference or id), it is not FluxOS's own file-operation image, and no install, redeploy, rebuild or test run is in progress, the last check and the removal in one synchronous step. A tagged image is removed by its tags, an untagged one by its id. Every image removal goes through it: the uninstaller's, and a pass at boot, everyimageReapPeriodblocks (720), after an image update that updated, and after each test run. The install-time dangling prune is removed.removedByFluxOsin the component's runtime state), and sends no removal it cannot record. The record is cleared when the container is created again, when the reconciler sees it in place, or with the app; the reconciler reads it before calling a missing container tampering, defers when it cannot read it, and leaves a container docker is still removing for a later pass. The in-memory list of removed containers is removed.fluxappremovedversion 2 names several apps. Every node reads version 2 (ip,apps,broadcastedAt) live and in a state sync, and keeps each message whole as one event with its names lowercased (removedNames). A node sends version 2 onceminimumFluxOSAllowedVersionis at leastappRemovedListFrom(8.25.0): the removals it announces while one is being sent go out together, the removals kept while peers would not accept its messages go out in one, and a node out of service removes its apps at once. Below it, a node sends version 1, one message per app, its out-of-service removalsnodeMonitorRemovalDelayMsapart. A removal not sent, because the node cannot sign or record it, is kept and announced on a later cycle, and the others are sent.fluxapprunningistype, version 2,apps,ip,broadcastedAt,osUptimeandstaticIp, every app exactly aname,hashandrunningSince; afluxappremovedistype, version 1 andappNameor version 2 andapps, withipandbroadcastedAt. Each field has its format: an app's name (the specification's rule, at most 63 characters), a specification hash (64 hex), a time astoISOStringwrites it, a node's address. Any other message is refused whole where it arrives, live or in a sync answer, and nothing of it is stored. At boot a node deletes any stored report or removal that is not well formed.noand each boot moves any other to it, so a container runs only once the reconciler starts it, after its volume is mounted.Release notes
Follows v9
utils/operationRegistry.js): app and component scopes, tokens, kept in memory, no node-wide flags. The rules on top are new: waiting, joining, steps, a removal stopping the running operation, and no timed release (a v9 lease expires after a per-type maximum, 30 minutes for most).hasSuccessfullyStarted,firstRunProofMs60 s) and its event (recreateFailedKept).dockerProbeTimeoutMs20 s,dockerStopSlackMs30 s,dockerRequestTimeoutMs120 s), in development's own docker code.imageReaper.pruneUnusedImagesandappUninstaller.reclaimUnusedImages, withoperationRegistry.anyHeldOfType; here the uninstaller's removals take its in-progress check too, and the reaper runs at boot, on its block period, after an image update and after a test run. v9's enterprise image cache is not part of it; at the rebase the rule gains itsshouldRetainImage.actuating,stopping,removing), so no two overlap on one container, replacingstoppingContainers.Testing
78f338d7e0, 13,673 passing, 0 failing, 2 pending; eslint clean. Each change is red without it and green with it. Docker deadlines are proven against a docker socket that takes a request and never answers: without the change each of eight request kinds is still waiting after its deadline; with it each fails at its own.78f338d7e0, ondevelopment396cc107bd: 342 of 342 suites passed.🤖 Generated with Claude Code