Repository navigation
Show job handle in "show unique jobs" output - #527
Merged
Merged
Conversation
Each line of the "show unique jobs" admin command (gearadmin --show-unique-jobs) is now "<job handle>\t<unique>" instead of just "<unique>", so a job submitted with a known unique ID can be mapped to the handle that "cancel job" expects. The handle comes first because it never contains a tab, while a unique ID may; splitting each line on the first tab stays unambiguous. This also matches the layout of "show jobs". This changes the output format of "show unique jobs". Scripts that treat the whole line as the unique ID need to take the text after the first tab instead. Fixes gearman#81 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Alexei Pastuchov <info@maximka.de>
esabol
approved these changes
Oct 14, 2026
Member
|
Thanks, @p-alik ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #81, as discussed with @esabol in #81 (comment).
Each line of
show unique jobs(gearadmin --show-unique-jobs) is now<job handle>\t<unique>instead of just<unique>. That lets you go from a unique ID to the handle thatcancel job/gearadmin --cancel-jobneeds.The handle comes first because it never contains a tab, while a unique ID may. Splitting each line on the first tab therefore stays unambiguous, and the layout matches
show jobs.Incompatible output change: scripts that read the whole
show unique jobsline as the unique ID need to take the text after the first tab instead. This is targeted at 2.2.0.Changes:
libgearman-server/text.cc: printjob_handle\tuniqueper line.docs/source/protocol/text.rst,docs/source/bin/gearadmin.rst,gearadmin --help: describe the new output (also fixes the "processesing" typo).tests/cli.cc: new test. It submits a background job with a known unique ID to a function that has no worker, checks that--show-unique-jobsprints<handle>\t<unique>, then passes that handle to--cancel-joband checks that--show-jobsreports the job as cancelled (ignore_job=1). The test fails without the server change.Note:
cancel jobis lazy. It marks the job as ignored, and the job is freed only when a worker would take it, so a cancelled job keeps showing up inshow jobs/show unique jobsuntil then. That behaviour is unchanged here.🤖 Generated with Claude Code