runtime: finalizers/cleanups can exit the finalizer goroutine #71824
Labels
BugReport
Issues describing a possible bug in the Go implementation.
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
All finalizers and cleanups run on a single goroutine started internally in the runtime. If a finalizer/cleanup calls Goexit, it will do what it says on the tin and exit the finalizer goroutine. No more finalizers/cleanups will run after that point.
At minimum, Goexit should probably detect this case and throw.
@ianlancetaylor put together https://go.dev/play/p/7jRsXx0W2OZ, which shows that the finalizers never run, but otherwise no error is reported.
cc @golang/runtime
The text was updated successfully, but these errors were encountered: