Skip to content

fix: skip files that vanish before being added to code bundle#1195

Open
EngHabu wants to merge 1 commit into
mainfrom
fix/sentry-52-bundle-vanished
Open

fix: skip files that vanish before being added to code bundle#1195
EngHabu wants to merge 1 commit into
mainfrom
fix/sentry-52-bundle-vanished

Conversation

@EngHabu

@EngHabu EngHabu commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Problem

The code bundle file list (ls) is computed by walking the source tree, but a file can disappear between listing and tar.add stat-ing it — most commonly a transient lock file (e.g. .codegraph/codegraph.lock). This raised a raw FileNotFoundError in tarfile.gettarinfo that aborted the entire deploy.

Sentry: FLYTE-SDK-52FileNotFoundError: [Errno 2] No such file or directory: '.../.codegraph/codegraph.lock' (culprit tarfile in gettarinfo, via _packaging.create_bundle).

Fix

Wrap tar.add in a try/except FileNotFoundError that logs a warning and skips the vanished file. A file disappearing mid-bundle is an environment race, not an SDK bug, and shouldn't abort the whole deploy — the rest of the bundle is still produced.

Tests

  • test_create_bundle_skips_files_that_vanish_before_add — a file present in the list but missing on disk is skipped; the bundle is still produced with the remaining files.

fixes FLYTE-SDK-52

@EngHabu EngHabu added the sentry-fix Fix for an issue surfaced by Sentry label Jun 11, 2026

@EngHabu EngHabu left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.. I'm guessing some of these maybe symlinked or something?

@EngHabu EngHabu requested review from kumare3 and pingsutw June 11, 2026 19:40
@EngHabu EngHabu enabled auto-merge (squash) June 11, 2026 19:41
The code bundle file list is computed by walking the source tree, but a
file can disappear between listing and tar.add stat-ing it — most
commonly a transient lock file (e.g. .codegraph/codegraph.lock). This
raised a raw FileNotFoundError that aborted the entire deploy
(FLYTE-SDK-52).

A vanished file is an environment race, not an SDK bug, so skip it with a
warning and continue producing the bundle.

fixes FLYTE-SDK-52

Signed-off-by: Haytham Abuelfutuh <haytham@afutuh.com>
@EngHabu EngHabu force-pushed the fix/sentry-52-bundle-vanished branch from fec58d4 to c11258f Compare June 12, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sentry-fix Fix for an issue surfaced by Sentry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant