Hi,
atexit_sleep_ms had proven to be extremely useful in C++ land to catch races between background threads and destructors of globals/function static objects.
I don't remember any Go atexit races (but I've seen much less Go races than C++ races, though). But the idea that you may have:
func main() {
...
go backgroundProcess(...)
...
foo.Shutdown()
}
func backgroundProcess(...) {
for {
time.Sleep(time.Second)
foo.DoSomething()
}
}
Here we have a race between foo.DoSomething() and foo.Shutdown(), but it unlikely will be found w/o atexit_sleep_ms.
Can you describe the context in which you need to set atexit_sleep_ms=0?
The concern is that if we set it to 0, since it only leads to false negatives, nobody will ever turn it on.