Fix listPathRaw/WalkDir cancelation (#11905)

In #11888 we observe a lot of running, WalkDir calls.

There doesn't appear to be any listerners for these calls, so they should be aborted.

Ensure that WalkDir aborts when upstream cancels the request.

Fixes #11888
This commit is contained in:
Klaus Post
2021-03-26 19:18:30 +01:00
committed by GitHub
parent 8d5456c15a
commit 9efcb9e15c
3 changed files with 28 additions and 1 deletions
+10
View File
@@ -428,3 +428,13 @@ func getTLSConfig() (x509Certs []*x509.Certificate, manager *certs.Manager, secu
secureConn = true
return x509Certs, manager, secureConn, nil
}
// contextCanceled returns whether a context is canceled.
func contextCanceled(ctx context.Context) bool {
select {
case <-ctx.Done():
return true
default:
return false
}
}