Skip to content

Fix dropped progress frames in POST-SSE responses - #6491

Open
isaacgao4396 wants to merge 1 commit into
stacklok:mainfrom
isaacgao4396:fix/post-sse-progress-ordering
Open

Fix dropped progress frames in POST-SSE responses#6491
isaacgao4396 wants to merge 1 commit into
stacklok:mainfrom
isaacgao4396:fix/post-sse-progress-ordering

Conversation

@isaacgao4396

Copy link
Copy Markdown

Summary

  • Drain request-scoped progress notifications already queued when the final POST-SSE response arrives.
  • Preserve backend ordering by emitting queued progress frames before the final response.
  • Add deterministic regression coverage for ordering, empty/nil routes, and SSE write failures.

Testing

  • go test -count=1 ./pkg/transport/proxy/streamable
  • go vet ./pkg/transport/proxy/streamable

Fixes #6349

Signed-off-by: isaacgao4396 <gaoyuan4396@gmail.com>

@jhrozek jhrozek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the fix — closes a genuine select-ordering race where a buffered progress notification could be skipped in favor of the final response. Drain-before-final logic is correct given dispatchResponses' strict per-channel ordering, and the new tests cover the ordering, no-op, and write-failure cases. LGTM.

@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.22222% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.25%. Comparing base (1af4f80) to head (e57506b).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
pkg/transport/proxy/streamable/streamable_proxy.go 72.22% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6491      +/-   ##
==========================================
+ Coverage   78.09%   78.25%   +0.15%     
==========================================
  Files         768      769       +1     
  Lines       74551    75061     +510     
==========================================
+ Hits        58220    58737     +517     
+ Misses      16326    16319       -7     
  Partials        5        5              

☔ 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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Progress notifications can be silently dropped in POST-SSE select race

3 participants