vmware-go-kcl-v2/clientlibrary/worker
Aurélien Rainone c8a5aa1891 Fix possible deadlock with getRecords in eventLoop (#42)
A waitgroup should always be incremented before the creation of the
goroutine which decrements it (through Done) or there is the
potential for deadlock.
That was not the case since the wg.Add was performed after the
`go getRecords() ` line.

Also, since there's only one path leading to the wg.Done in getRecords,
I moved wg.Done out of the getRecords function and placed it
alongside the goroutine creation, thus totally removing the need to
pass the waitgroup pointer to the sc instance, this lead to the
removal of the `waitGroup` field from the `ShardConsumer` struct.

This has been tested in production and didn't create any problem.

Signed-off-by: Aurélien Rainone <aurelien.rainone@gmail.com>
2021-12-20 21:21:14 -06:00
..
record-processor-checkpointer.go Add support for providing custom checkpointer (#17) 2021-12-20 21:21:14 -06:00
shard-consumer.go Fix possible deadlock with getRecords in eventLoop (#42) 2021-12-20 21:21:14 -06:00
worker.go Fix possible deadlock with getRecords in eventLoop (#42) 2021-12-20 21:21:14 -06:00