Skip to content

xds: fix race condition in ext_proc client interceptor halfClose - #12948

Open
kannanjgithub wants to merge 1 commit into
grpc:masterfrom
kannanjgithub:halfClose-draining-race-fix
Open

xds: fix race condition in ext_proc client interceptor halfClose#12948
kannanjgithub wants to merge 1 commit into
grpc:masterfrom
kannanjgithub:halfClose-draining-race-fix

Conversation

@kannanjgithub

@kannanjgithub kannanjgithub commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Fixes a race condition in ExternalProcessorClientInterceptor$DataPlaneClientCall.halfClose() that can cause the call to hang when the external processor stream completes concurrently.

If the external processor stream completes (marking state as COMPLETED and setting passThroughMode to true) after halfClose() has already checked passThroughMode (seeing false), halfClose() would subsequently see the state as COMPLETED and return early without invoking proceedWithHalfClose().

This commit fixes the race by re-checking passThroughMode inside the isCompleted() block in halfClose(), ensuring we proceed with half-close if pass-through mode was enabled late.

Fixes a race condition in ExternalProcessorClientInterceptor$DataPlaneClientCall.halfClose()
that can cause the call to hang when the external processor stream completes concurrently.

If the external processor stream completes (marking state as COMPLETED and setting
passThroughMode to true) after halfClose() has already checked passThroughMode (seeing false),
halfClose() would subsequently see the state as COMPLETED and return early without
invoking proceedWithHalfClose().

This commit fixes the race by re-checking passThroughMode inside the isCompleted() block in
halfClose(), ensuring we proceed with half-close if pass-through mode was enabled late.
@kannanjgithub
kannanjgithub requested a review from sauravzg July 29, 2026 13:52
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.

1 participant