Skip to content

Conversation

@arjan-bal
Copy link
Contributor

@arjan-bal arjan-bal commented Aug 21, 2025

Original PR: #8519
Related issue: #8514

RELEASE NOTES:

  • transport: Fix a data race while copying headers for stats handlers in the std lib http2 server transport.
…ler_server (grpc#8519)

Fixes: grpc#8514


The mutex that guards the trailers should be held while copying the
trailers. We do lock the mutex in [the regular gRPC server
transport](https://github.com/grpc/grpc-go/blob/9ac0ec87ca2ecc66b3c0c084708aef768637aef6/internal/transport/http2_server.go#L1140-L1142),
but have missed it in the std lib http/2 transport. The only place where
a write happens is `writeStatus()` is when the status contains a proto.


https://github.com/grpc/grpc-go/blob/4375c784450aa7e43ff15b8b2879c896d0917130/internal/transport/handler_server.go#L251-L252

RELEASE NOTES:
* transport: Fix a data race while copying headers for stats handlers in
the std lib http2 server transport.
@arjan-bal arjan-bal added this to the 1.75 Release milestone Aug 21, 2025
@codecov
Copy link

codecov bot commented Aug 21, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.74%. Comparing base (7269d5f) to head (06ab697).
⚠️ Report is 1 commits behind head on v1.75.x.

Files with missing lines Patch % Lines
internal/transport/handler_server.go 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           v1.75.x    #8530      +/-   ##
===========================================
- Coverage    81.77%   81.74%   -0.04%     
===========================================
  Files          413      413              
  Lines        40530    40570      +40     
===========================================
+ Hits         33145    33163      +18     
- Misses        6003     6005       +2     
- Partials      1382     1402      +20     
Files with missing lines Coverage Δ
internal/transport/handler_server.go 70.55% <50.00%> (-15.92%) ⬇️

... and 24 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@dfawley dfawley assigned arjan-bal and unassigned dfawley Aug 21, 2025
@arjan-bal arjan-bal merged commit 369c9aa into grpc:v1.75.x Aug 21, 2025
18 of 19 checks passed
@arjan-bal arjan-bal deleted the cherry-pick/8519 branch August 21, 2025 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants