Skip to content

Commit

Permalink
Merge pull request kubernetes#100669 from tkashem/automated-cherry-pi…
Browse files Browse the repository at this point in the history
…ck-of-#100638-upstream-release-1.19

Automated cherry pick of kubernetes#100638: apf: fix data race in queueset
  • Loading branch information
k8s-ci-robot committed Mar 30, 2021
2 parents 1a11e2a + 2392e90 commit 9b98186
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,11 @@ func (qs *queueSet) StartRequest(ctx context.Context, hashValue uint64, flowDist
// request's context's Done channel gets closed by the time
// the request is done being processed.
doneCh := ctx.Done()

// Retrieve the queueset configuration name while we have the lock
// and use it in the goroutine below.
configName := qs.qCfg.Name

if doneCh != nil {
qs.preCreateOrUnblockGoroutine()
go func() {
Expand All @@ -297,7 +302,7 @@ func (qs *queueSet) StartRequest(ctx context.Context, hashValue uint64, flowDist
// known that the count does not need to be accurate.
// BTW, the count only needs to be accurate in a test that
// uses FakeEventClock::Run().
klog.V(6).Infof("QS(%s): Context of request %q %#+v %#+v is Done", qs.qCfg.Name, fsName, descr1, descr2)
klog.V(6).Infof("QS(%s): Context of request %q %#+v %#+v is Done", configName, fsName, descr1, descr2)
qs.cancelWait(req)
qs.goroutineDoneOrBlocked()
}()
Expand Down

0 comments on commit 9b98186

Please sign in to comment.