-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
http2: avoid racy access to clientStream.requestedGzip
clientStream.requestedGzip is set from clientStream.writeRequest, and examined by clientConn.readLoop. I'm not sure if there's any possible way for an actual data race to happen here in practice, since the read loop should only examine the field after the request is sent by writeRequest, but it's enough for the race detector to complain. Set the field in ClientConn.roundTrip instead, before the clientStream has become accessible to any other goroutines. No test, but a following CL has race detector failures without this change. Change-Id: Id30f1b95bcfcc35c213440e0e47cce3feaaff06d Reviewed-on: https://go-review.googlesource.com/c/net/+/586245 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Jonathan Amsterdam <[email protected]>
- Loading branch information
Showing
2 changed files
with
21 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters