Skip to content

[test/integration] Defer fake upstream read enable until initialize#45029

Merged
nezdolik merged 3 commits into
mainfrom
test-integration-fix
May 20, 2026
Merged

[test/integration] Defer fake upstream read enable until initialize#45029
nezdolik merged 3 commits into
mainfrom
test-integration-fix

Conversation

@nezdolik
Copy link
Copy Markdown
Member

When FakeUpstream hands off HTTP connections via consumeConnection(), reads were re-enabled before the codec/filter stack was initialized. This could cause early request bytes to be consumed without creating a FakeStream. Defer read re-enable until FakeHttpConnection::initialize() attaches the HTTP read filter.

Commit Message: [test/integration] Defer fake upstream read enable until initialize
Additional Description:
Risk Level: Low (test code)
Testing:
Docs Changes: NA
Release Notes:
Platform Specific Features:

Signed-off-by: Kateryna Nezdolii <kateryna.nezdolii@gmail.com>
@nezdolik
Copy link
Copy Markdown
Member Author

cc @jrajahalme

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts the FakeUpstream HTTP handoff flow so that when a connection is moved from new_connections_ to a FakeHttpConnection, network reads aren’t re-enabled until the HTTP codec/filter stack is ready, avoiding a race where early request bytes can be consumed before a FakeStream is created.

Changes:

  • Add a FakeHttpConnection::initialize() override and use it as the point to (re-)enable reads when appropriate.
  • Extend FakeUpstream::consumeConnection() with defer_read_enable to optionally postpone readDisable(false).
  • Update HTTP connection creation paths to pass defer_read_enable=true and rely on initialize() to re-enable reads.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
test/integration/fake_upstream.h Declares FakeHttpConnection::initialize() override; extends consumeConnection() API with defer_read_enable.
test/integration/fake_upstream.cc Implements deferred read re-enable in FakeHttpConnection::initialize() and updates HTTP connection creation to defer read enabling.

Comment thread test/integration/fake_upstream.cc Outdated
Comment thread test/integration/fake_upstream.cc Outdated
Comment thread test/integration/fake_upstream.cc Outdated
Signed-off-by: Kateryna Nezdolii <kateryna.nezdolii@isovalent.com>
@kyessenov kyessenov self-assigned this May 13, 2026
@kyessenov
Copy link
Copy Markdown
Contributor

CI failure looks real.
/wait

Signed-off-by: Kateryna Nezdolii <kateryna.nezdolii@gmail.com>
@nezdolik nezdolik enabled auto-merge (squash) May 19, 2026 15:40
@nezdolik nezdolik merged commit bd77d3e into main May 20, 2026
29 checks passed
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.

3 participants