fix(runtime): exit 77 when collected data cannot be written for lack of disk - #1205
Open
gastonyelmini wants to merge 2 commits into
Open
fix(runtime): exit 77 when collected data cannot be written for lack of disk#1205gastonyelmini wants to merge 2 commits into
gastonyelmini wants to merge 2 commits into
Conversation
…of disk Every graph object the integration collects is written to disk before it is uploaded, so an ENOSPC there is unrecoverable. Today it propagates as an ordinary error: the step executor marks that step failed and moves on to the next one, which fails the same way, and the job finishes "with errors" having exited 0. For managed integrations that clean exit is the whole problem. The ECS state machine only reaches HandleTaskFailure when the task itself fails, so a task that ran the disk dry is never retried on a larger volume — the scaling path added to jupiter-integration-service can never fire. It also publishes a partial graph, which looks to the customer like their data disappeared rather than like a failed run. Fail the process instead, with the exit code HandleTaskFailure reads as "retry with a bigger disk". The diagnostic goes to stderr synchronously because process.exit does not flush pending async writes, and that line is the only record of why the task died. writeFileToPath and symlink are the two calls flushDataToDisk makes, so this covers every graph object write without touching the call sites.
…the stderr mock leaking between tests
gastonyelmini
force-pushed
the
out-of-disk-exit
branch
from
August 7, 2026 20:59
70a7205 to
7fc072e
Compare
tom-foley-j1
approved these changes
Aug 7, 2026
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.
Problem
An integration that fills its volume currently finishes with exit code 0.
Every graph object collected is written to disk before upload, so
ENOSPCthere is unrecoverable — but it propagates as an ordinary error.flushDataToDisklogsFailed to write chunk to diskand rethrows, the step executor marks that one step failed and moves on to the next, which fails the same way, and the job ends "with errors" having exited cleanly.For managed integrations that clean exit is the whole problem. The ECS state machine only reaches
HandleTaskFailurewhen the task itself fails, so a task that ran the disk dry is never retried on a larger volume and the disk-scaling path injupiter-integration-servicecan never fire. It also publishes a partial graph, which looks to the customer like their data disappeared rather than like a failed run.Real example: integration job
fc815601-295c-42d8-acd8-302b49e267c5hitENOSPC, exited 0, andhandle-task-failurenever ran — no lambda logs exist for that task.Change
writeFileToPathandsymlink— the two callsflushDataToDiskmakes, and therefore the funnel every graph object write passes through — detectENOSPCand exit with code 77, whichhandleTaskFailurealready reads as "retry this task with a bigger disk". Every other error keeps behaving exactly as before.The diagnostic is written to fd 2 with
writeSyncbecauseprocess.exitdoes not flush pending async writes, and that line is the only record of why the task died.Notes for review
process.exitin the SDK's production code. The localj1-integrationCLI shares this path, where the effect is that filling the disk stops the run instead of producing a confusing stack trace.OUT_OF_DISK_EXIT_CODEis exported and covered by a test, because the value is a contract with a separately deployed service.Testing
8 new tests in
src/__tests__/fileSystem.test.tscovering the write, mkdir, symlink and JSON paths, the stderr diagnostic, an unwritable stderr, and the non-ENOSPCpassthrough. Fullintegration-sdk-runtimesuite green (301/301).