Skip to content

Retry storage operation on idle connection error during raw file uploads#7368

Draft
ddl-rliu wants to merge 2 commits into
flyteorg:masterfrom
ddl-rliu:rliu.writeraw-retry
Draft

Retry storage operation on idle connection error during raw file uploads#7368
ddl-rliu wants to merge 2 commits into
flyteorg:masterfrom
ddl-rliu:rliu.writeraw-retry

Conversation

@ddl-rliu

@ddl-rliu ddl-rliu commented May 13, 2026

Copy link
Copy Markdown
Contributor

Tracking issue

Similar issue to flyteorg/flyteadmin#325

Why are the changes needed?

What changes were proposed in this pull request?

How was this patch tested?

Labels

Please add one or more of the following labels to categorize your PR:

  • added: For new features.
  • changed: For changes in existing functionality.
  • deprecated: For soon-to-be-removed features.
  • removed: For features being removed.
  • fixed: For any bug fixed.
  • security: In case of vulnerabilities

This is important to improve the readability of release notes.

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Stack

If you do use git town to manage PR Stacks, the stack relevant to this PR
will show below. Otherwise, you can ignore this section.

Docs link

@github-actions github-actions Bot added the flyte label May 13, 2026
@ddl-rliu
ddl-rliu force-pushed the rliu.writeraw-retry branch 3 times, most recently from 147d1b9 to ca37329 Compare May 14, 2026 00:02
Workflows with 100+ large (100MB+) file outputs lead to failures in the sidecar.
These failures appear to be due to transient errors during the upload phase.
Large file outputs (anything > 5MB) lead to a MultipartUpload, and flytecopilot
attempts to parallelize file uploads. However, it appears the parallelism causes
idle connections from a set of completed uploads to interfere with in-progress
connections for other uploads.

Since the failures are transient, implement a fix where copilot simply initiates
a retry (up to 5 max retries) if a transient error is seen during a flytecopilot
raw file upload. This fix is consistent with a similar issue seen previously in
Flyte storage writes: flyteorg/flyteadmin#325
@ddl-rliu ddl-rliu changed the title Retry storage operation on idle connection error Retry storage operation on idle connection error during raw file uploads May 14, 2026
@ddl-rliu
ddl-rliu force-pushed the rliu.writeraw-retry branch from ca37329 to 3674473 Compare May 14, 2026 02:10
As part of the previous fix, flytecopilot simply initiates a retry (up to 5 max
retries) if a transient error is seen during a flytecopilot raw file upload.
This corresponds to the following list of four specific transient network errors:
 - "http: server closed idle connection"
 - "use of closed network connection"
 - "EOF"
 - "write: broken pipe"
These four network errors were discovered during the local reproduction of the
issue.

However, during a live run, a new transient network error "WebidentityErr:
failed to retrieve credentials ... status code: 408" was observed (Note the
status code 408 in particular). In order to update the retry logic to be more
robust against unanticipated transient errors, we relax the retry logic to retry
on all errors.
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.98%. Comparing base (08a8d43) to head (6fd96ae).
⚠️ Report is 220 commits behind head on master.

Files with missing lines Patch % Lines
flytecopilot/data/retry.go 72.22% 4 Missing and 1 partial ⚠️
flytecopilot/data/utils.go 71.42% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7368      +/-   ##
==========================================
- Coverage   58.47%   56.98%   -1.50%     
==========================================
  Files         940      932       -8     
  Lines       71562    58317   -13245     
==========================================
- Hits        41849    33230    -8619     
+ Misses      26532    22027    -4505     
+ Partials     3181     3060     -121     
Flag Coverage Δ
unittests-datacatalog 53.51% <ø> (-5.53%) ⬇️
unittests-flyteadmin 53.15% <ø> (-3.09%) ⬇️
unittests-flytecopilot 43.96% <72.00%> (+12.96%) ⬆️
unittests-flytectl 64.09% <ø> (-0.62%) ⬇️
unittests-flyteidl 75.71% <ø> (-0.42%) ⬇️
unittests-flyteplugins 60.24% <ø> (-0.71%) ⬇️
unittests-flytepropeller 53.71% <ø> (-1.08%) ⬇️
unittests-flytestdlib 62.62% <ø> (-1.40%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant