Repository navigation
Conversation
(cherry picked from commit 2a035022bc3b3c8a352f3063a1d5688f3c293ed4)
(cherry picked from commit 096452f544319c602f607c70ee91675d4352f095)
(cherry picked from commit 052911425880ce8adc59ef9d1aad647aa43a0f8c)
Telemetry uploads and signalling admission share one credential proof slot. Each upload holds it pending for at least the 1 s cooldown, and an admission that arrived then got busy for the rest of the telemetry proof TTL, which can exceed the Connector's 8 s admission deadline. A generic (interactive) issuance now expires a pending telemetry challenge under the slot row lock and issues its own. The retired proof is denied and commits nothing; the Connector resends the batch. Telemetry never retires another challenge and generic challenges never replace each other. No schema change. (cherry picked from commit 2f0e94d581b84222d1634f12638b1994469a5ba5)
(cherry picked from commit 751f730d6fcc84cae4970884356629665fba04dc)
bloodf
left a comment
There was a problem hiding this comment.
Please address the remaining admission fairness issue before merging 6715a5d. The shared cooldown is advanced before a telemetry proof is checked against the current challenge. Keep renewal and single-use guarantees intact while ensuring superseded telemetry cannot consume time reserved for an interactive proof. Extend the PostgreSQL regression to cover that ordering with both traffic types inside the cooldown window. The scoped journey passes with the proof fix reverted, so credit the PostgreSQL test for detecting the regression and the journey for end-to-end coverage.
A telemetry proof whose challenge was superseded by a later issuance (an interactive admission retiring it) advanced next_attempt_at before it was compared with the slot's current challenge, delaying the interactive proof that owns the slot. Superseded proofs and lapsed current ones are now denied before the cooldown, admission lock and failure counter are touched. Renewal, single-use, row-lock order and one-way priority are unchanged. Extends the disposable-PostgreSQL contention test (root and successor credentials, real roles) with both traffic types inside the cooldown window; it fails when this fix is reverted. (cherry picked from commit b75de0bf4dbaffe08efc12b5cbab33632f70ad9a)
bloodf
left a comment
There was a problem hiding this comment.
The successor path still acquires the shared cryptographic admission slot and verifies the credential before the new superseded-proof check (around lines 361 and 514). Under concurrent superseded successor telemetry, those 32 slots can be occupied before interactive admission gets one. Please address that path while preserving single-use and concurrent replay semantics, and add a concurrent PostgreSQL regression. The new sequential root/successor test passes, but it does not exercise admission-slot contention.
Draft until the Full Review verdict on the exact head.
#963 review follow-ups that did not reach main, because #963 was squash-merged at its pre-fix head:
runtime/pause-driver-router.ts): the Anycubic start-up firmware read now runs only for a model in the Anycubic LAN model table with a qualified pair, so Kobra 3 (20024) and other bindings never trigger it.tests/node/fix-963b.test.tsfails on revert (it sees an unexpected firmware query).apps/farm/server/storage/postgres-connector-credential-acceptance.ts): each Connector credential has one proof slot shared by telemetry, signalling inboxes and context challenges. A telemetry upload kept it pending for at least 1 s, so a WebRTC admission arriving then gotbusywithretryAfterMs: 7000. The Connector refuses retries past its 8 s admission deadline, so the direct session closed and a print start after upload failed. Now an interactive request (signalling inbox, pause, context) that finds a pending telemetry challenge expires it and issues its own, in the same transaction under the slot's row lock.tests/node/fix-963c-proof-contention.test.tsruns against a disposable PostgreSQL with the real roles, for root and successor credentials, and fails on revert withbusy/7000 ms.busy(atomic-telemetry test unchanged). The PostgreSQL test "a superseded telemetry proof never consumes cooldown reserved for the interactive proof" (root and successor credentials, both traffic types inside the cooldown window) is the regression detector: on revert it getsbusy, retryAfterMs: 500instead ofdenied. The journey is end-to-end coverage and passes either way.tests/journey/anycubic.spec.ts): wait for the inspector tile after a WebRTC reconnect, using the harness's existing wait, since main also timed out there. An interim commit paused telemetry during file operations, and the last commit removes that pause, so telemetry keeps flowing during upload, start and job end.Validated on this head:
tests/journey/anycubic-models.spec.tsandtests/journey/anycubic.spec.tstogether, 14 passed (10.5 min), withplaywright.journey.config.ts, bundled Chromium and loopback simulators. Focused node tests pass. The host's required checks must pass on this head before merging.Known: other journey specs (moonraker, bambu, flashforge, fullfarmmanager) still pause telemetry the same way, and a comment in
tests/journey/farm-app.ts(~119) still describes the old contention.Refs #963