[apscheduler] fail preview chains safe when the idle deadline is lost - #289
Open
ricardo-agz wants to merge 1 commit into
Open
[apscheduler] fail preview chains safe when the idle deadline is lost#289ricardo-agz wants to merge 1 commit into
ricardo-agz wants to merge 1 commit into
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ricardo-agz
force-pushed
the
ricardo/aps-preview-idle-failsafe
branch
from
August 12, 2026 02:04
221de82 to
d704b3b
Compare
ricardo-agz
force-pushed
the
ricardo/aps-preview-idle-failsafe
branch
from
August 12, 2026 02:16
d704b3b to
8a5bf74
Compare
ricardo-agz
force-pushed
the
ricardo/aps-preview-idle-failsafe
branch
from
August 12, 2026 02:20
8a5bf74 to
c83c0fc
Compare
ricardo-agz
force-pushed
the
ricardo/aps-preview-idle-failsafe
branch
from
August 13, 2026 21:58
c83c0fc to
3f1527c
Compare
The idle deadline lives only in the driver document. When that document was evicted, the next wake adopted the chain from the message and rebuilt it with no deadline, so an abandoned preview kept invoking Functions until its deployment was deleted. Start and wake payloads now carry a config-derived idle_bounded marker, and a claim refuses to adopt an idle-bounded chain into a document without a deadline: for a disposable preview, absence maps to stopped, and the next real request re-activates it. Adoption and refusal both log, making cache eviction observable in production. Old messages without the field parse as unbounded.
ricardo-agz
force-pushed
the
ricardo/aps-preview-idle-failsafe
branch
from
August 13, 2026 22:33
3f1527c to
24dfd41
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prevent runaway preview environment chains:
An opted-in preview whose driver document was evicted lost its idle deadline, and the next wake adopted the chain from the message and kept it running with no traffic requirement until the deployment was deleted.
The core intuition: the idle deadline lives only in the document, so for an idle-bounded chain, document absence must mean stop, not run. Start and wake payloads now carry a config-derived
idle_boundedmarker (canonical across racing publishers), and a claim refuses to adopt an idle-bounded chain into a document without a deadline. The next real request re-activates the preview and skips the inactive interval — the already-documented expiry behavior.Production and development are untouched: they are never idle-bounded, so their adoption rule (message is the authority, absence never strands the chain) is unchanged, including the
vercel devsidecar's per-process memory.Also makes eviction observable: the driver logs whenever it rebuilds state from a message or refuses an idle-bounded adoption. Old messages without the payload field parse as unbounded.