mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-26 15:35:55 +03:00
[GH-ISSUE #353] [BUG] Dangling program #2180
Labels
No labels
CLI
bug
designing
documentation
duplicate
enhancement
good first issue
good first issue
help wanted
idea
invalid
investigate
needs-more-info
performance
pr-welcome
pull-request
question
wontfix
work in progress
work in progress
work-around-available
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/asynq#2180
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @1337-sys on GitHub (Nov 20, 2021).
Original GitHub issue: https://github.com/hibiken/asynq/issues/353
Originally assigned to: @hibiken on GitHub.
Program could not be closed. Previously I was calling the Stop() and Shutdown() funcs. Same result whether I call it or not. Asynq is already handling the shutdown job. Even though I set ShutdownTimeout, nothing changed.
Initialize:
Destroy:
Machine: Darwin Kernel Version 20.6.0 - MacBook Pro (Retina, 15-inch, Mid 2014) - MacOS Big Sur
@hibiken commented on GitHub (Nov 20, 2021):
@1337-sys Thank you for opening an issue.
You should be able to fix this by replacing the call to
Server.RunwithServer.Start. For more context,Server.Runtakes care of callingServer.StopandSever.Shutdown. But in this case, since you are calling those methods yourself, you should useServer.Startto start the server. Also, you don't need to put that call in a separate goroutine sinceServer.Startwon't block.Note to myself:
The bug surfaces when you call
Server.Shutdownconcurrently while another goroutine is already shutting down the server. To fix, introduce another stateShutdownInProgressand skip the shutdown operation.