Skip to content

runtime: finalizers/cleanups can exit the finalizer goroutine #71824

@prattmic

Description

@prattmic

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

Metadata

Metadata

Assignees

Labels

BugReportIssues describing a possible bug in the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.

Type

No type

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions