Skip to content

[WIP] ext_proc/test: Attempt to fix observability flake - #47626

Closed
phlax wants to merge 1 commit into
envoyproxy:mainfrom
phlax:ext_proc-flake
Closed

phlax wants to merge 1 commit into
envoyproxy:mainfrom
phlax:ext_proc-flake

Conversation

@phlax

@phlax phlax commented Sep 22, 2026

Copy link
Copy Markdown
Member

No description provided.

@phlax

phlax commented Sep 22, 2026

Copy link
Copy Markdown
Member Author

bot verdict

Net: it's a reasonable low-risk narrowing of the window and worth merging to see if the flake rate drops, but the comment's confidence outpaces the mechanism — I'd expect it to reduce rather than eliminate the flake.

@phlax phlax changed the title ext_proc/test: Attempt to fix observability flake [WIP] ext_proc/test: Attempt to fix observability flake Sep 22, 2026
@phlax
phlax marked this pull request as draft September 22, 2026 11:15
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions Bot added the stale stalebot believes this issue/PR has not been touched recently label Oct 22, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions Bot closed this Oct 29, 2026
phlax pushed a commit that referenced this pull request Nov 15, 2026
In observability mode the main request doesn't wait for the ext_proc
side stream. The test has the fake ext_proc server send its response
headers and then has the main upstream answer straight away, from a
different thread on a different socket, so Envoy can finish the main
response first. The logging test filter then reads the side stream's
response code details as `""` instead of `"via_upstream"`
(`logging_test_filter.cc:47`).

This waits for `cluster.ext_proc_server_0.upstream_rq_200` before
answering the main request, since the router charges it in the same
callback that sets `via_upstream`. It's the same race #47390 fixed for
the `CloseStream` variant.

Additional Description:
Over the last 30 days of Envoy/Checks this failed on 9 changes (3 main
postsubmit, 4 release/v1.39 postsubmit, 2 unrelated PRs) on OpenSSL,
Coverage, asan and Compile time options, always on the Envoy gRPC params
`/0` and `/2`. Draft #47626 waits on the same counter, but after
`handleUpstreamRequest()`, which is too late to order the two, and with
the removed `waitForCounterGe`.

To force the ordering locally, I posted a 1s sleep onto the fake
ext_proc connection's thread just before `startGrpcStream()`. Without
the fix, `/0` and `/2` failed on every run with the CI message, and `/1`
and `/3` passed. With the fix and the sleep, every run passed.

AI Disclosure: code change created with AI assistance, fully reviewed by
me prior to opening.

Risk Level: Low (test only)
Testing:
- forced-ordering repro above: 6/6 failures before, 0 after
- `bazel test
//test/extensions/filters/http/ext_proc:ext_proc_observability_integration_test
--test_filter='*ObservabilityModeWithLogging/*' --runs_per_test=20`:
80/80 pass (macOS arm64, fastbuild)
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Derek Argueta <[email protected]>
phlax pushed a commit to phlax/envoy that referenced this pull request Nov 15, 2026
In observability mode the main request doesn't wait for the ext_proc
side stream. The test has the fake ext_proc server send its response
headers and then has the main upstream answer straight away, from a
different thread on a different socket, so Envoy can finish the main
response first. The logging test filter then reads the side stream's
response code details as `""` instead of `"via_upstream"`
(`logging_test_filter.cc:47`).

This waits for `cluster.ext_proc_server_0.upstream_rq_200` before
answering the main request, since the router charges it in the same
callback that sets `via_upstream`. It's the same race envoyproxy#47390 fixed for
the `CloseStream` variant.

Additional Description:
Over the last 30 days of Envoy/Checks this failed on 9 changes (3 main
postsubmit, 4 release/v1.39 postsubmit, 2 unrelated PRs) on OpenSSL,
Coverage, asan and Compile time options, always on the Envoy gRPC params
`/0` and `/2`. Draft envoyproxy#47626 waits on the same counter, but after
`handleUpstreamRequest()`, which is too late to order the two, and with
the removed `waitForCounterGe`.

To force the ordering locally, I posted a 1s sleep onto the fake
ext_proc connection's thread just before `startGrpcStream()`. Without
the fix, `/0` and `/2` failed on every run with the CI message, and `/1`
and `/3` passed. With the fix and the sleep, every run passed.

AI Disclosure: code change created with AI assistance, fully reviewed by
me prior to opening.

Risk Level: Low (test only)
Testing:
- forced-ordering repro above: 6/6 failures before, 0 after
- `bazel test
//test/extensions/filters/http/ext_proc:ext_proc_observability_integration_test
--test_filter='*ObservabilityModeWithLogging/*' --runs_per_test=20`:
80/80 pass (macOS arm64, fastbuild)
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Derek Argueta <[email protected]>
Signed-off-by: Ryan Northey <[email protected]>
phlax pushed a commit to phlax/envoy that referenced this pull request Nov 16, 2026
In observability mode the main request doesn't wait for the ext_proc
side stream. The test has the fake ext_proc server send its response
headers and then has the main upstream answer straight away, from a
different thread on a different socket, so Envoy can finish the main
response first. The logging test filter then reads the side stream's
response code details as `""` instead of `"via_upstream"`
(`logging_test_filter.cc:47`).

This waits for `cluster.ext_proc_server_0.upstream_rq_200` before
answering the main request, since the router charges it in the same
callback that sets `via_upstream`. It's the same race envoyproxy#47390 fixed for
the `CloseStream` variant.

Additional Description:
Over the last 30 days of Envoy/Checks this failed on 9 changes (3 main
postsubmit, 4 release/v1.39 postsubmit, 2 unrelated PRs) on OpenSSL,
Coverage, asan and Compile time options, always on the Envoy gRPC params
`/0` and `/2`. Draft envoyproxy#47626 waits on the same counter, but after
`handleUpstreamRequest()`, which is too late to order the two, and with
the removed `waitForCounterGe`.

To force the ordering locally, I posted a 1s sleep onto the fake
ext_proc connection's thread just before `startGrpcStream()`. Without
the fix, `/0` and `/2` failed on every run with the CI message, and `/1`
and `/3` passed. With the fix and the sleep, every run passed.

AI Disclosure: code change created with AI assistance, fully reviewed by
me prior to opening.

Risk Level: Low (test only)
Testing:
- forced-ordering repro above: 6/6 failures before, 0 after
- `bazel test
//test/extensions/filters/http/ext_proc:ext_proc_observability_integration_test
--test_filter='*ObservabilityModeWithLogging/*' --runs_per_test=20`:
80/80 pass (macOS arm64, fastbuild)
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Derek Argueta <[email protected]>
Signed-off-by: Ryan Northey <[email protected]>
phlax pushed a commit to phlax/envoy that referenced this pull request Nov 16, 2026
In observability mode the main request doesn't wait for the ext_proc
side stream. The test has the fake ext_proc server send its response
headers and then has the main upstream answer straight away, from a
different thread on a different socket, so Envoy can finish the main
response first. The logging test filter then reads the side stream's
response code details as `""` instead of `"via_upstream"`
(`logging_test_filter.cc:47`).

This waits for `cluster.ext_proc_server_0.upstream_rq_200` before
answering the main request, since the router charges it in the same
callback that sets `via_upstream`. It's the same race envoyproxy#47390 fixed for
the `CloseStream` variant.

Additional Description:
Over the last 30 days of Envoy/Checks this failed on 9 changes (3 main
postsubmit, 4 release/v1.39 postsubmit, 2 unrelated PRs) on OpenSSL,
Coverage, asan and Compile time options, always on the Envoy gRPC params
`/0` and `/2`. Draft envoyproxy#47626 waits on the same counter, but after
`handleUpstreamRequest()`, which is too late to order the two, and with
the removed `waitForCounterGe`.

To force the ordering locally, I posted a 1s sleep onto the fake
ext_proc connection's thread just before `startGrpcStream()`. Without
the fix, `/0` and `/2` failed on every run with the CI message, and `/1`
and `/3` passed. With the fix and the sleep, every run passed.

AI Disclosure: code change created with AI assistance, fully reviewed by
me prior to opening.

Risk Level: Low (test only)
Testing:
- forced-ordering repro above: 6/6 failures before, 0 after
- `bazel test
//test/extensions/filters/http/ext_proc:ext_proc_observability_integration_test
--test_filter='*ObservabilityModeWithLogging/*' --runs_per_test=20`:
80/80 pass (macOS arm64, fastbuild)
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Derek Argueta <[email protected]>
(cherry picked from commit 02153b3)
Signed-off-by: Ryan Northey <[email protected]>
phlax pushed a commit to phlax/envoy that referenced this pull request Nov 16, 2026
In observability mode the main request doesn't wait for the ext_proc
side stream. The test has the fake ext_proc server send its response
headers and then has the main upstream answer straight away, from a
different thread on a different socket, so Envoy can finish the main
response first. The logging test filter then reads the side stream's
response code details as `""` instead of `"via_upstream"`
(`logging_test_filter.cc:47`).

This waits for `cluster.ext_proc_server_0.upstream_rq_200` before
answering the main request, since the router charges it in the same
callback that sets `via_upstream`. It's the same race envoyproxy#47390 fixed for
the `CloseStream` variant.

Additional Description:
Over the last 30 days of Envoy/Checks this failed on 9 changes (3 main
postsubmit, 4 release/v1.39 postsubmit, 2 unrelated PRs) on OpenSSL,
Coverage, asan and Compile time options, always on the Envoy gRPC params
`/0` and `/2`. Draft envoyproxy#47626 waits on the same counter, but after
`handleUpstreamRequest()`, which is too late to order the two, and with
the removed `waitForCounterGe`.

To force the ordering locally, I posted a 1s sleep onto the fake
ext_proc connection's thread just before `startGrpcStream()`. Without
the fix, `/0` and `/2` failed on every run with the CI message, and `/1`
and `/3` passed. With the fix and the sleep, every run passed.

AI Disclosure: code change created with AI assistance, fully reviewed by
me prior to opening.

Risk Level: Low (test only)
Testing:
- forced-ordering repro above: 6/6 failures before, 0 after
- `bazel test
//test/extensions/filters/http/ext_proc:ext_proc_observability_integration_test
--test_filter='*ObservabilityModeWithLogging/*' --runs_per_test=20`:
80/80 pass (macOS arm64, fastbuild)
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Derek Argueta <[email protected]>
(cherry picked from commit 02153b3)
Signed-off-by: Ryan Northey <[email protected]>
phlax pushed a commit to phlax/envoy that referenced this pull request Nov 16, 2026
In observability mode the main request doesn't wait for the ext_proc
side stream. The test has the fake ext_proc server send its response
headers and then has the main upstream answer straight away, from a
different thread on a different socket, so Envoy can finish the main
response first. The logging test filter then reads the side stream's
response code details as `""` instead of `"via_upstream"`
(`logging_test_filter.cc:47`).

This waits for `cluster.ext_proc_server_0.upstream_rq_200` before
answering the main request, since the router charges it in the same
callback that sets `via_upstream`. It's the same race envoyproxy#47390 fixed for
the `CloseStream` variant.

Additional Description:
Over the last 30 days of Envoy/Checks this failed on 9 changes (3 main
postsubmit, 4 release/v1.39 postsubmit, 2 unrelated PRs) on OpenSSL,
Coverage, asan and Compile time options, always on the Envoy gRPC params
`/0` and `/2`. Draft envoyproxy#47626 waits on the same counter, but after
`handleUpstreamRequest()`, which is too late to order the two, and with
the removed `waitForCounterGe`.

To force the ordering locally, I posted a 1s sleep onto the fake
ext_proc connection's thread just before `startGrpcStream()`. Without
the fix, `/0` and `/2` failed on every run with the CI message, and `/1`
and `/3` passed. With the fix and the sleep, every run passed.

AI Disclosure: code change created with AI assistance, fully reviewed by
me prior to opening.

Risk Level: Low (test only)
Testing:
- forced-ordering repro above: 6/6 failures before, 0 after
- `bazel test
//test/extensions/filters/http/ext_proc:ext_proc_observability_integration_test
--test_filter='*ObservabilityModeWithLogging/*' --runs_per_test=20`:
80/80 pass (macOS arm64, fastbuild)
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Derek Argueta <[email protected]>
(cherry picked from commit 02153b3)
Signed-off-by: Ryan Northey <[email protected]>
phlax pushed a commit to phlax/envoy that referenced this pull request Nov 16, 2026
In observability mode the main request doesn't wait for the ext_proc
side stream. The test has the fake ext_proc server send its response
headers and then has the main upstream answer straight away, from a
different thread on a different socket, so Envoy can finish the main
response first. The logging test filter then reads the side stream's
response code details as `""` instead of `"via_upstream"`
(`logging_test_filter.cc:47`).

This waits for `cluster.ext_proc_server_0.upstream_rq_200` before
answering the main request, since the router charges it in the same
callback that sets `via_upstream`. It's the same race envoyproxy#47390 fixed for
the `CloseStream` variant.

Additional Description:
Over the last 30 days of Envoy/Checks this failed on 9 changes (3 main
postsubmit, 4 release/v1.39 postsubmit, 2 unrelated PRs) on OpenSSL,
Coverage, asan and Compile time options, always on the Envoy gRPC params
`/0` and `/2`. Draft envoyproxy#47626 waits on the same counter, but after
`handleUpstreamRequest()`, which is too late to order the two, and with
the removed `waitForCounterGe`.

To force the ordering locally, I posted a 1s sleep onto the fake
ext_proc connection's thread just before `startGrpcStream()`. Without
the fix, `/0` and `/2` failed on every run with the CI message, and `/1`
and `/3` passed. With the fix and the sleep, every run passed.

AI Disclosure: code change created with AI assistance, fully reviewed by
me prior to opening.

Risk Level: Low (test only)
Testing:
- forced-ordering repro above: 6/6 failures before, 0 after
- `bazel test
//test/extensions/filters/http/ext_proc:ext_proc_observability_integration_test
--test_filter='*ObservabilityModeWithLogging/*' --runs_per_test=20`:
80/80 pass (macOS arm64, fastbuild)
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Derek Argueta <[email protected]>
(cherry picked from commit 02153b3)
Signed-off-by: Ryan Northey <[email protected]>
phlax pushed a commit to phlax/envoy that referenced this pull request Nov 16, 2026
In observability mode the main request doesn't wait for the ext_proc
side stream. The test has the fake ext_proc server send its response
headers and then has the main upstream answer straight away, from a
different thread on a different socket, so Envoy can finish the main
response first. The logging test filter then reads the side stream's
response code details as `""` instead of `"via_upstream"`
(`logging_test_filter.cc:47`).

This waits for `cluster.ext_proc_server_0.upstream_rq_200` before
answering the main request, since the router charges it in the same
callback that sets `via_upstream`. It's the same race envoyproxy#47390 fixed for
the `CloseStream` variant.

Additional Description:
Over the last 30 days of Envoy/Checks this failed on 9 changes (3 main
postsubmit, 4 release/v1.39 postsubmit, 2 unrelated PRs) on OpenSSL,
Coverage, asan and Compile time options, always on the Envoy gRPC params
`/0` and `/2`. Draft envoyproxy#47626 waits on the same counter, but after
`handleUpstreamRequest()`, which is too late to order the two, and with
the removed `waitForCounterGe`.

To force the ordering locally, I posted a 1s sleep onto the fake
ext_proc connection's thread just before `startGrpcStream()`. Without
the fix, `/0` and `/2` failed on every run with the CI message, and `/1`
and `/3` passed. With the fix and the sleep, every run passed.

AI Disclosure: code change created with AI assistance, fully reviewed by
me prior to opening.

Risk Level: Low (test only)
Testing:
- forced-ordering repro above: 6/6 failures before, 0 after
- `bazel test
//test/extensions/filters/http/ext_proc:ext_proc_observability_integration_test
--test_filter='*ObservabilityModeWithLogging/*' --runs_per_test=20`:
80/80 pass (macOS arm64, fastbuild)
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Derek Argueta <[email protected]>
(cherry picked from commit 02153b3)
Signed-off-by: Ryan Northey <[email protected]>
phlax pushed a commit to phlax/envoy that referenced this pull request Nov 16, 2026
In observability mode the main request doesn't wait for the ext_proc
side stream. The test has the fake ext_proc server send its response
headers and then has the main upstream answer straight away, from a
different thread on a different socket, so Envoy can finish the main
response first. The logging test filter then reads the side stream's
response code details as `""` instead of `"via_upstream"`
(`logging_test_filter.cc:47`).

This waits for `cluster.ext_proc_server_0.upstream_rq_200` before
answering the main request, since the router charges it in the same
callback that sets `via_upstream`. It's the same race envoyproxy#47390 fixed for
the `CloseStream` variant.

Additional Description:
Over the last 30 days of Envoy/Checks this failed on 9 changes (3 main
postsubmit, 4 release/v1.39 postsubmit, 2 unrelated PRs) on OpenSSL,
Coverage, asan and Compile time options, always on the Envoy gRPC params
`/0` and `/2`. Draft envoyproxy#47626 waits on the same counter, but after
`handleUpstreamRequest()`, which is too late to order the two, and with
the removed `waitForCounterGe`.

To force the ordering locally, I posted a 1s sleep onto the fake
ext_proc connection's thread just before `startGrpcStream()`. Without
the fix, `/0` and `/2` failed on every run with the CI message, and `/1`
and `/3` passed. With the fix and the sleep, every run passed.

AI Disclosure: code change created with AI assistance, fully reviewed by
me prior to opening.

Risk Level: Low (test only)
Testing:
- forced-ordering repro above: 6/6 failures before, 0 after
- `bazel test
//test/extensions/filters/http/ext_proc:ext_proc_observability_integration_test
--test_filter='*ObservabilityModeWithLogging/*' --runs_per_test=20`:
80/80 pass (macOS arm64, fastbuild)
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Derek Argueta <[email protected]>
(cherry picked from commit 02153b3)
Signed-off-by: Ryan Northey <[email protected]>
phlax pushed a commit to phlax/envoy that referenced this pull request Nov 16, 2026
In observability mode the main request doesn't wait for the ext_proc
side stream. The test has the fake ext_proc server send its response
headers and then has the main upstream answer straight away, from a
different thread on a different socket, so Envoy can finish the main
response first. The logging test filter then reads the side stream's
response code details as `""` instead of `"via_upstream"`
(`logging_test_filter.cc:47`).

This waits for `cluster.ext_proc_server_0.upstream_rq_200` before
answering the main request, since the router charges it in the same
callback that sets `via_upstream`. It's the same race envoyproxy#47390 fixed for
the `CloseStream` variant.

Additional Description:
Over the last 30 days of Envoy/Checks this failed on 9 changes (3 main
postsubmit, 4 release/v1.39 postsubmit, 2 unrelated PRs) on OpenSSL,
Coverage, asan and Compile time options, always on the Envoy gRPC params
`/0` and `/2`. Draft envoyproxy#47626 waits on the same counter, but after
`handleUpstreamRequest()`, which is too late to order the two, and with
the removed `waitForCounterGe`.

To force the ordering locally, I posted a 1s sleep onto the fake
ext_proc connection's thread just before `startGrpcStream()`. Without
the fix, `/0` and `/2` failed on every run with the CI message, and `/1`
and `/3` passed. With the fix and the sleep, every run passed.

AI Disclosure: code change created with AI assistance, fully reviewed by
me prior to opening.

Risk Level: Low (test only)
Testing:
- forced-ordering repro above: 6/6 failures before, 0 after
- `bazel test
//test/extensions/filters/http/ext_proc:ext_proc_observability_integration_test
--test_filter='*ObservabilityModeWithLogging/*' --runs_per_test=20`:
80/80 pass (macOS arm64, fastbuild)
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Derek Argueta <[email protected]>
(cherry picked from commit 02153b3)
Signed-off-by: Ryan Northey <[email protected]>
phlax pushed a commit to phlax/envoy that referenced this pull request Nov 16, 2026
In observability mode the main request doesn't wait for the ext_proc
side stream. The test has the fake ext_proc server send its response
headers and then has the main upstream answer straight away, from a
different thread on a different socket, so Envoy can finish the main
response first. The logging test filter then reads the side stream's
response code details as `""` instead of `"via_upstream"`
(`logging_test_filter.cc:47`).

This waits for `cluster.ext_proc_server_0.upstream_rq_200` before
answering the main request, since the router charges it in the same
callback that sets `via_upstream`. It's the same race envoyproxy#47390 fixed for
the `CloseStream` variant.

Additional Description:
Over the last 30 days of Envoy/Checks this failed on 9 changes (3 main
postsubmit, 4 release/v1.39 postsubmit, 2 unrelated PRs) on OpenSSL,
Coverage, asan and Compile time options, always on the Envoy gRPC params
`/0` and `/2`. Draft envoyproxy#47626 waits on the same counter, but after
`handleUpstreamRequest()`, which is too late to order the two, and with
the removed `waitForCounterGe`.

To force the ordering locally, I posted a 1s sleep onto the fake
ext_proc connection's thread just before `startGrpcStream()`. Without
the fix, `/0` and `/2` failed on every run with the CI message, and `/1`
and `/3` passed. With the fix and the sleep, every run passed.

AI Disclosure: code change created with AI assistance, fully reviewed by
me prior to opening.

Risk Level: Low (test only)
Testing:
- forced-ordering repro above: 6/6 failures before, 0 after
- `bazel test
//test/extensions/filters/http/ext_proc:ext_proc_observability_integration_test
--test_filter='*ObservabilityModeWithLogging/*' --runs_per_test=20`:
80/80 pass (macOS arm64, fastbuild)
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Derek Argueta <[email protected]>
(cherry picked from commit 02153b3)
Signed-off-by: Ryan Northey <[email protected]>
phlax pushed a commit that referenced this pull request Nov 17, 2026
In observability mode the main request doesn't wait for the ext_proc
side stream. The test has the fake ext_proc server send its response
headers and then has the main upstream answer straight away, from a
different thread on a different socket, so Envoy can finish the main
response first. The logging test filter then reads the side stream's
response code details as `""` instead of `"via_upstream"`
(`logging_test_filter.cc:47`).

This waits for `cluster.ext_proc_server_0.upstream_rq_200` before
answering the main request, since the router charges it in the same
callback that sets `via_upstream`. It's the same race #47390 fixed for
the `CloseStream` variant.

Additional Description:
Over the last 30 days of Envoy/Checks this failed on 9 changes (3 main
postsubmit, 4 release/v1.39 postsubmit, 2 unrelated PRs) on OpenSSL,
Coverage, asan and Compile time options, always on the Envoy gRPC params
`/0` and `/2`. Draft #47626 waits on the same counter, but after
`handleUpstreamRequest()`, which is too late to order the two, and with
the removed `waitForCounterGe`.

To force the ordering locally, I posted a 1s sleep onto the fake
ext_proc connection's thread just before `startGrpcStream()`. Without
the fix, `/0` and `/2` failed on every run with the CI message, and `/1`
and `/3` passed. With the fix and the sleep, every run passed.

AI Disclosure: code change created with AI assistance, fully reviewed by
me prior to opening.

Risk Level: Low (test only)
Testing:
- forced-ordering repro above: 6/6 failures before, 0 after
- `bazel test
//test/extensions/filters/http/ext_proc:ext_proc_observability_integration_test
--test_filter='*ObservabilityModeWithLogging/*' --runs_per_test=20`:
80/80 pass (macOS arm64, fastbuild)
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Derek Argueta <[email protected]>
Signed-off-by: Ryan Northey <[email protected]>
phlax pushed a commit to phlax/envoy that referenced this pull request Nov 17, 2026
In observability mode the main request doesn't wait for the ext_proc
side stream. The test has the fake ext_proc server send its response
headers and then has the main upstream answer straight away, from a
different thread on a different socket, so Envoy can finish the main
response first. The logging test filter then reads the side stream's
response code details as `""` instead of `"via_upstream"`
(`logging_test_filter.cc:47`).

This waits for `cluster.ext_proc_server_0.upstream_rq_200` before
answering the main request, since the router charges it in the same
callback that sets `via_upstream`. It's the same race envoyproxy#47390 fixed for
the `CloseStream` variant.

Additional Description:
Over the last 30 days of Envoy/Checks this failed on 9 changes (3 main
postsubmit, 4 release/v1.39 postsubmit, 2 unrelated PRs) on OpenSSL,
Coverage, asan and Compile time options, always on the Envoy gRPC params
`/0` and `/2`. Draft envoyproxy#47626 waits on the same counter, but after
`handleUpstreamRequest()`, which is too late to order the two, and with
the removed `waitForCounterGe`.

To force the ordering locally, I posted a 1s sleep onto the fake
ext_proc connection's thread just before `startGrpcStream()`. Without
the fix, `/0` and `/2` failed on every run with the CI message, and `/1`
and `/3` passed. With the fix and the sleep, every run passed.

AI Disclosure: code change created with AI assistance, fully reviewed by
me prior to opening.

Risk Level: Low (test only)
Testing:
- forced-ordering repro above: 6/6 failures before, 0 after
- `bazel test
//test/extensions/filters/http/ext_proc:ext_proc_observability_integration_test
--test_filter='*ObservabilityModeWithLogging/*' --runs_per_test=20`:
80/80 pass (macOS arm64, fastbuild)
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Derek Argueta <[email protected]>
(cherry picked from commit 02153b3)
Signed-off-by: Ryan Northey <[email protected]>
phlax pushed a commit to phlax/envoy that referenced this pull request Nov 17, 2026
In observability mode the main request doesn't wait for the ext_proc
side stream. The test has the fake ext_proc server send its response
headers and then has the main upstream answer straight away, from a
different thread on a different socket, so Envoy can finish the main
response first. The logging test filter then reads the side stream's
response code details as `""` instead of `"via_upstream"`
(`logging_test_filter.cc:47`).

This waits for `cluster.ext_proc_server_0.upstream_rq_200` before
answering the main request, since the router charges it in the same
callback that sets `via_upstream`. It's the same race envoyproxy#47390 fixed for
the `CloseStream` variant.

Additional Description:
Over the last 30 days of Envoy/Checks this failed on 9 changes (3 main
postsubmit, 4 release/v1.39 postsubmit, 2 unrelated PRs) on OpenSSL,
Coverage, asan and Compile time options, always on the Envoy gRPC params
`/0` and `/2`. Draft envoyproxy#47626 waits on the same counter, but after
`handleUpstreamRequest()`, which is too late to order the two, and with
the removed `waitForCounterGe`.

To force the ordering locally, I posted a 1s sleep onto the fake
ext_proc connection's thread just before `startGrpcStream()`. Without
the fix, `/0` and `/2` failed on every run with the CI message, and `/1`
and `/3` passed. With the fix and the sleep, every run passed.

AI Disclosure: code change created with AI assistance, fully reviewed by
me prior to opening.

Risk Level: Low (test only)
Testing:
- forced-ordering repro above: 6/6 failures before, 0 after
- `bazel test
//test/extensions/filters/http/ext_proc:ext_proc_observability_integration_test
--test_filter='*ObservabilityModeWithLogging/*' --runs_per_test=20`:
80/80 pass (macOS arm64, fastbuild)
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Derek Argueta <[email protected]>
(cherry picked from commit 02153b3)
Signed-off-by: Ryan Northey <[email protected]>
phlax pushed a commit to phlax/envoy that referenced this pull request Nov 17, 2026
In observability mode the main request doesn't wait for the ext_proc
side stream. The test has the fake ext_proc server send its response
headers and then has the main upstream answer straight away, from a
different thread on a different socket, so Envoy can finish the main
response first. The logging test filter then reads the side stream's
response code details as `""` instead of `"via_upstream"`
(`logging_test_filter.cc:47`).

This waits for `cluster.ext_proc_server_0.upstream_rq_200` before
answering the main request, since the router charges it in the same
callback that sets `via_upstream`. It's the same race envoyproxy#47390 fixed for
the `CloseStream` variant.

Additional Description:
Over the last 30 days of Envoy/Checks this failed on 9 changes (3 main
postsubmit, 4 release/v1.39 postsubmit, 2 unrelated PRs) on OpenSSL,
Coverage, asan and Compile time options, always on the Envoy gRPC params
`/0` and `/2`. Draft envoyproxy#47626 waits on the same counter, but after
`handleUpstreamRequest()`, which is too late to order the two, and with
the removed `waitForCounterGe`.

To force the ordering locally, I posted a 1s sleep onto the fake
ext_proc connection's thread just before `startGrpcStream()`. Without
the fix, `/0` and `/2` failed on every run with the CI message, and `/1`
and `/3` passed. With the fix and the sleep, every run passed.

AI Disclosure: code change created with AI assistance, fully reviewed by
me prior to opening.

Risk Level: Low (test only)
Testing:
- forced-ordering repro above: 6/6 failures before, 0 after
- `bazel test
//test/extensions/filters/http/ext_proc:ext_proc_observability_integration_test
--test_filter='*ObservabilityModeWithLogging/*' --runs_per_test=20`:
80/80 pass (macOS arm64, fastbuild)
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Derek Argueta <[email protected]>
(cherry picked from commit 02153b3)
Signed-off-by: Ryan Northey <[email protected]>
phlax pushed a commit that referenced this pull request Nov 17, 2026
In observability mode the main request doesn't wait for the ext_proc
side stream. The test has the fake ext_proc server send its response
headers and then has the main upstream answer straight away, from a
different thread on a different socket, so Envoy can finish the main
response first. The logging test filter then reads the side stream's
response code details as `""` instead of `"via_upstream"`
(`logging_test_filter.cc:47`).

This waits for `cluster.ext_proc_server_0.upstream_rq_200` before
answering the main request, since the router charges it in the same
callback that sets `via_upstream`. It's the same race #47390 fixed for
the `CloseStream` variant.

Additional Description:
Over the last 30 days of Envoy/Checks this failed on 9 changes (3 main
postsubmit, 4 release/v1.39 postsubmit, 2 unrelated PRs) on OpenSSL,
Coverage, asan and Compile time options, always on the Envoy gRPC params
`/0` and `/2`. Draft #47626 waits on the same counter, but after
`handleUpstreamRequest()`, which is too late to order the two, and with
the removed `waitForCounterGe`.

To force the ordering locally, I posted a 1s sleep onto the fake
ext_proc connection's thread just before `startGrpcStream()`. Without
the fix, `/0` and `/2` failed on every run with the CI message, and `/1`
and `/3` passed. With the fix and the sleep, every run passed.

AI Disclosure: code change created with AI assistance, fully reviewed by
me prior to opening.

Risk Level: Low (test only)
Testing:
- forced-ordering repro above: 6/6 failures before, 0 after
- `bazel test
//test/extensions/filters/http/ext_proc:ext_proc_observability_integration_test
--test_filter='*ObservabilityModeWithLogging/*' --runs_per_test=20`:
80/80 pass (macOS arm64, fastbuild)
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Derek Argueta <[email protected]>
(cherry picked from commit 02153b3)
Signed-off-by: Ryan Northey <[email protected]>
phlax pushed a commit to phlax/envoy that referenced this pull request Nov 18, 2026
In observability mode the main request doesn't wait for the ext_proc
side stream. The test has the fake ext_proc server send its response
headers and then has the main upstream answer straight away, from a
different thread on a different socket, so Envoy can finish the main
response first. The logging test filter then reads the side stream's
response code details as `""` instead of `"via_upstream"`
(`logging_test_filter.cc:47`).

This waits for `cluster.ext_proc_server_0.upstream_rq_200` before
answering the main request, since the router charges it in the same
callback that sets `via_upstream`. It's the same race envoyproxy#47390 fixed for
the `CloseStream` variant.

Additional Description:
Over the last 30 days of Envoy/Checks this failed on 9 changes (3 main
postsubmit, 4 release/v1.39 postsubmit, 2 unrelated PRs) on OpenSSL,
Coverage, asan and Compile time options, always on the Envoy gRPC params
`/0` and `/2`. Draft envoyproxy#47626 waits on the same counter, but after
`handleUpstreamRequest()`, which is too late to order the two, and with
the removed `waitForCounterGe`.

To force the ordering locally, I posted a 1s sleep onto the fake
ext_proc connection's thread just before `startGrpcStream()`. Without
the fix, `/0` and `/2` failed on every run with the CI message, and `/1`
and `/3` passed. With the fix and the sleep, every run passed.

AI Disclosure: code change created with AI assistance, fully reviewed by
me prior to opening.

Risk Level: Low (test only)
Testing:
- forced-ordering repro above: 6/6 failures before, 0 after
- `bazel test
//test/extensions/filters/http/ext_proc:ext_proc_observability_integration_test
--test_filter='*ObservabilityModeWithLogging/*' --runs_per_test=20`:
80/80 pass (macOS arm64, fastbuild)
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Derek Argueta <[email protected]>
(cherry picked from commit 02153b3)
Signed-off-by: Ryan Northey <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale stalebot believes this issue/PR has not been touched recently

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant