Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

signalReceivers should call Signal.Stop(recv.signals) when stopped #1197

Closed
MarcoPolo opened this issue May 8, 2024 · 0 comments · Fixed by #1198
Closed

signalReceivers should call Signal.Stop(recv.signals) when stopped #1197

MarcoPolo opened this issue May 8, 2024 · 0 comments · Fixed by #1198

Comments

@MarcoPolo
Copy link
Contributor

Describe the bug

signalReceivers should call Signal.Stop(recv.signals) when they are Stop()ed.

Because if not, then when a user does:

app.Start(...)
app.Close(...)

// block on anything else
select {} // for example

the program will fail to exit when the user presses ctrl-c. Which is contrary to what one would expect after starting and stopping the fx app.

To Reproduce

Example

func main() {
	app := fx.New()
	app.Start(context.Background())
	app.Stop(context.Background())

	select {}
}

ctrl-c should exit the program

Expected behavior
the signal handler reverts back to Go's default signal handler

Additional context
should be a ~1 line change :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant