Commit 99c75b47 authored by Brian Bland's avatar Brian Bland

Force-kill the batcher if the Stop context is ever done

parent acc22d76
......@@ -173,6 +173,15 @@ func (l *BatchSubmitter) Stop(ctx context.Context) error {
}
l.running = false
// go routine will call cancelKill() if the passed in ctx is ever Done
cancelKill := l.cancelKillCtx
wrapped, cancel := context.WithCancel(ctx)
defer cancel()
go func() {
<-wrapped.Done()
cancelKill()
}()
l.cancelShutdownCtx()
l.wg.Wait()
l.cancelKillCtx()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment