mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-25 23:15:51 +03:00
[GH-ISSUE #768] Question: Individual ServerInfo and identifying current server via UUID #373
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#373
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 @kamikazechaser on GitHub (Oct 19, 2023).
Original GitHub issue: https://github.com/hibiken/asynq/issues/768
I have another question on graceful shutdown that I think is related to this; The server has a Stop() and a Shutdown(), from reading the comments Stop() prevents the server from picking up more tasks and Shutdown() well .. shutsdown. In theory one can call Stop() on a server, then wait until that server has finished processing all it's tasks, then call Shutdown().
Looking at the inspector I can see a Servers() call which returns all servers, and serverinfos include an ID. But I can't see how I can get the ID of the server I called Stop() on ..?
So in practice, I'm unclear how I would check that the server I've just called Stop() on is actually ready for Shutdown(). I mean, sure I could set some kind of max task time and wait that long before shutdown .. but that seems a little weird.
I'd like to request:
.. Happy to add myself if you want.
My apologies if there is a way to do this currently and I haven't found it!
Originally posted by @voidshard in https://github.com/hibiken/asynq/issues/710#issuecomment-1762784681
@kamikazechaser commented on GitHub (Oct 19, 2023):
Yeah. But calling shutdown is enough as it will call processor.stop() internally (same as Stop()).
Hmm. seems correct, the heartbeater doesn't log this info.
Would a debug log line be enough?
At the inspector level? It could be possible.
@voidshard commented on GitHub (Oct 20, 2023):
Yeah. But calling shutdown is enough as it will call processor.stop() internally (same as Stop()).In local testing Stop() doesn't seem to block though (apologies if I'm wrong here, I can check the code when I have time) -- if Stop() does block until it's finished processing everything it has then that's ok.
Would a debug log line be enough?At the inspector level? It could be possible.My idea here was that I could have something in my code that checks that the server has finished processing before allowing it to be killed -- so I'd want a way to get the ID in code that wraps the server.
WAITflag for Enqueue #1175WAITflag for Enqueue #2186