Skip to content

Commit 7654271

Browse files
committed
resourcemanage: avoid to get nil pointer after task finishes when to call Stop
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
1 parent ea6891f commit 7654271

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

util/gpool/spmc/spmcpool_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ func TestStopPool(t *testing.T) {
114114
control.Stop()
115115
close(exit)
116116
control.Wait()
117+
// it should pass. Stop can be used after the pool is closed. we should prevent it from panic.
118+
control.Stop()
117119
wg.Wait()
118120
// close pool
119121
pool.ReleaseAndWait()

0 commit comments

Comments
 (0)