Comments (6)
Are you restarting the goworker application? We see this behaviour when the application is hard-stopped and doesn't have time to cleanup the records in Redis (workers
and worker:[node]
keys).
from goworker.
@mingan Yes, sometimes we are re-deploying the Docker containers when jobs are still running, that might be the cause. I think we should definitely cleanup when starting up again.
Edit:
node-resque
does something like this to cleanup:
const shutdown = async () => {
await scheduler.end();
await worker.end();
process.exit();
};
process.on('SIGTERM', shutdown);
process.on('SIGINT', shutdown);
from goworker.
Yeah, the problem is to figure out a safe mechanism to do so and keep it compatible with the Resque gem.
from goworker.
We don't have any disadvantage from those jobs other than memory consumption from Redis, right? So concurrency still works as expected and the stuck jobs are not being considered by goworker
anymore?
from goworker.
If it's the same issue we have experienced, there are extra values in the set of workers and the dead workers appear to still be working in the UI (there are records under the given prefix). I'm not sure if the jobs themselves are failed or abandoned, that might be an issue.
There's similar code in goworker https://github.com/benmanns/goworker/blob/master/signals.go which stops polling and stops idle workers. I don't remember it correctly and don't have time to look it up at the moment but I think it doesn't force a running worker to stop so unless it finishes normally, it might hang.
from goworker.
This logic should be added like it's on the "main" Resque: https://github.com/resque/resque/blob/master/lib/resque/worker.rb#L599
Which basically consists on having a heartbeat
and a prune
function when the worker is started which will expire old workers.
I'll try to work on this and add it to the lib, would this be something that would be merged if implemented? (cc @benmanns)
from goworker.
Related Issues (20)
- How to panic handling on Job? HOT 2
- 100% cpu usage HOT 17
- Any plans to support Sidekiq backend? HOT 4
- Refactor the Enqueue API
- RabbitMQ Support HOT 1
- Example from Getting Started section doesn't run
- New version HOT 3
- How does goworker work? HOT 4
- Any plan to replace garyburd/redigo with gomodule/redigo? HOT 2
- redis please use go-redis
- Supporting Resque Scheduler
- package broken
- missing the prefillParallelism argument in redis.go
- etcd support
- It's graceful, but how to optimize cpu usage? HOT 2
- pools.NewResourcePool request param has changed
- fail to install HOT 4
- There is atomicity problem when worker key is flushed by redis pool
- [Critical] Error on closing worker ip-xxx-xx-xx-xx:xxxxxx-4:xxx: redis: client is closed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goworker.