Commit Graph

4 Commits

Author SHA1 Message Date
slasher
25c669644e chore(code): code static check package util
Signed-off-by: slasher <shenjie1@oppo.com>
2023-06-14 19:27:09 +08:00
leonrayang
9a30b9f884 update: update to CubeFS
Signed-off-by: leonrayang <chl696@sina.com>
2022-08-22 18:16:09 +08:00
Sheng Yong
93922d62c0 unin test: Add WaitGroup before goroutine starts
If the `wg.Add(1)` is called inside a goroutine, there is no guarantee
that `wg.Wait` is called before all `wg.Add(1)`. So `wg.Add(1)` should
be called before goroutine starts. Otherwise, the following error
occurs:

```
panic: sync: WaitGroup is reused before previous Wait has returned [recovered]
	panic: sync: WaitGroup is reused before previous Wait has returned

goroutine 18 [running]:
testing.tRunner.func1.2(0x51cac0, 0x56ebb0)
	/usr/local/go/src/testing/testing.go:1143 +0x332
testing.tRunner.func1(0xc00009e300)
	/usr/local/go/src/testing/testing.go:1146 +0x4b6
panic(0x51cac0, 0x56ebb0)
	/usr/local/go/src/runtime/panic.go:965 +0x1b9
sync.(*WaitGroup).Wait(0xc000098080)
	/usr/local/go/src/sync/waitgroup.go:132 +0xae
github.com/cubefs/cubefs/util/synclist.TestSyncPushBach(0xc00009e300)
	/root/tmp/cfs/go/src/github.com/cubefs/cubefs/util/synclist/synclist_test.go:79 +0xf3
testing.tRunner(0xc00009e300, 0x54f988)
	/usr/local/go/src/testing/testing.go:1193 +0xef
created by testing.(*T).Run
	/usr/local/go/src/testing/testing.go:1238 +0x2b3
```

Signed-off-by: Sheng Yong <shengyong2021@gmail.com>
2022-03-14 14:45:06 +08:00
zhuzhengyi1
c3a53426cf Fix: use sync list to replace list for partition_delete_extents
Signed-off-by: zhuzhengyi1 <zhuzhengyi@jd.com>
2020-06-08 15:48:18 +08:00