Unscheduable garbage collection job and how I solved it #21188
SISheogorath
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The other day I had a garbage collection job that was never picked up by a worker from the jobservice. All other queues worked fine, even scheduling one worked, but it was never picked up.
Since I never found the answer despite seeing some issues showing similar problems e.g. #20029, #19494 (comment), #18900
I dug down and found the problem: A stale lock for the job in redis.
Caution
This is low level tinkering with your setup and might break it, follow at your own risk. Please use your brain, thanks! 🧠
So If anyone experiences that a job is stuck or not picked up, like in my case the
GARBAGE_COLLECTION
, here is how I solved it:redis-cli -n 1
for me)keys *GARBAGE_COLLECTION*
, if it's broken the same way as mine, it looks like this:GET "{harbor_job_service_namespace}:jobs:GARBAGE_COLLECTION:lock"
it should return "1" if it's locked (which is the origin of the problem)inprogress
entry (remember, we stopped/restarted the job service to make sure nothing is running):DEL "{harbor_job_service_namespace}:jobs:GARBAGE_COLLECTION:19b507bb4308eac2e7711356:inprogress"
SET "{harbor_job_service_namespace}:jobs:GARBAGE_COLLECTION:lock" "0"
Since this topic seems to come up similarly ever now and then, I couldn't find the answer in any of the threads, I hope this is a good place to provide this info.
Beta Was this translation helpful? Give feedback.
All reactions