Skip to content

Commit 7226f8e

Browse files
committed
Do not use parent context to avoid cascading cancellation of requests
1 parent dc61158 commit 7226f8e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

race_transport.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func (t *raceTransport) RoundTrip(req *http.Request) (*http.Response, error) {
7979
// Create a request with a cloned body to avoid issues with concurrent reads and also
8080
// set a lower timeout for the actual request so any single request doesn't use our whole
8181
// allotted time.
82-
requestCtx, requestCancel := context.WithTimeout(ctx, 10*time.Second)
82+
requestCtx, requestCancel := context.WithTimeout(context.Background(), 10*time.Second)
8383
req = cloneRequest(req, t.appName, rt.name).WithContext(requestCtx)
8484
resp, err := rt.RoundTrip(req)
8585
if err != nil {

0 commit comments

Comments
 (0)