-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: HTTPTransport.Flush panic and data race
Rewrite HTTPTransport internals to remove a data race and occasional panics. Prior to this, HTTPTransport used a `sync.WaitGroup` to track how many in-flight requests existed, and `Flush` waited until the observed number of in-flight requests reached zero. Unsynchronized access to the WaitGroup lead to panics (reuse before wg.Wait returns) and data races (undefined order of wg.Add and wg.Wait calls). The new implementation changes the `Flush` behavior to wait until the current in-flight requests are processed, inline with other SDKs and the Unified API.
- Loading branch information
1 parent
c34ccc5
commit 4277850
Showing
1 changed file
with
83 additions
and
33 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