-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.Issue is not actionable because of missing required information, which needs to be provided.
Description
I'm using context with net/http.Request. Recently I made a mistake:
ctx, cancel := context.WithTimeout(r.Context(), timeout)
defer cancel()
<...>
next.ServeHTTP(w, r) // <-- child context has not been passedSo here is something missing, either
next.ServeHTTP(w, r.WithContext(ctx)) or
r = r.WithContext(ctx)
However, what I found is that it doesn't change anything. So in called handler I can run this code:
select {
<...>
case <-r.Context().Done():
fmt.Println("Parent context expired?")
<...>
}and see this message as output.
Parent context expired?
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.Issue is not actionable because of missing required information, which needs to be provided.