Comments (8)
First, thanks for the bug report!
Why is our application crashing?
Is this expected?
The application dies cause the Verk.Supervisor is restarting too many times (because the workers manager is restarting too many times). It's really simple to tweak the restart strategy to be something like: "max restart times 99999" and possibly :infinity
so that Verk.Supervisor
will never cause a restart of the supervisor above (the App supervisor probably)
We could also discuss that the workers manager should never give up restarting (but then what if there's actually a bug on it or something?)
What if we call Poison.decode instead and then move jobs with bad JSON into a malformed key in Redis?
That's a hard one. I'm not sure what's the best approach when the data can't be parsed properly. This should be an edge case, right? I would like some solution that doesn't complicate a lot the flow of data but it also gives enough information to the user that something was wrong. Maybe logging for now would be enough?
from verk.
Would it be possible to add a new GenEvent and report it that way along with logging?
from verk.
Thank you both for providing some help and suggestions! To answer them:
We could also discuss that the workers manager should never give up restarting (but then what if there's actually a bug on it or something?)
I agree, this would not be a good thing to do. I'm fine with not changing that.
I'm not sure what's the best approach when the data can't be parsed properly. This should be an edge case, right?
Possibly? Our usage right now is to encode the jobs into JSON from a legacy PHP app and write to Redis, Verk then picks up the job. I imagine this is likely a common workflow, although maybe coming from Ruby applications.
I would like some solution that doesn't complicate a lot the flow of data but it also gives enough information to the user that something was wrong.
I agree that a complication of data movement is not ideal. I did some initial work, but admittedly it does complicate things: https://github.com/edgurgel/verk/compare/master...keyan:malformed_set_encoding_issues?expand=1
Maybe logging for now would be enough?
Are you suggesting we delete the job and log it? I think that would be reasonable in general, but in my case I have ~5000 emails stuck in Redis, probably a large number are malformed. I probably have to recover the data somehow if Verk cannot process it, so logging and deleting the job wouldn't be enough.
Would it be possible to add a new GenEvent and report it that way along with logging?
@mitchellhenke, as in do the logging inside of a handler? Is this what you mean?
def handle_event({:malformed, job}, message) do
Logger.error "#{message}"
end
I agree we have to log something. What are your thoughts on finding a way to put the jobs into the DeadSet
? I think it makes sense that malformed jobs would be sent there, it doesn't complicate the flow too much, and still allows for a way to keep the jobs should you need to recover them.
Thoughts?
from verk.
Okay, I poked around and tried implementing something to send jobs to the dead queue when malformed, and it was pretty messy. I'm okay with just logging the job for now.
Any suggestions on how to handle this? QueueManager.dequeue
will have already moved the job into the inprogress
queue, see here. We need to remove the job before logging and skipping it. Any input is appreciated!
from verk.
Yeah we need to add to the dead set and then remove from the inprogress
acknowledging the job.
from verk.
@edgurgel, oh okay. I misunderstood. I thought you didn't want to move it to the dead set, just log and remove from inprogress
(which is what I did in #91). I'll update there.
from verk.
Yeah I wasn't clear! I'm not super decided on which solution to take but logging is way easier :D
from verk.
Haha no worries. I agree, logging is way easier. I worked on first pass which sent the jobs to the dead set and it complicated things more than I'd like. Given that you are on the fence and the complication you mentioned in #91 (comment), I am going to go forward with just logging and removing the job.
I ran the changes in #91 in production and we were able to clear our queues, only 5 jobs had the malformed data issue. I think this is an edge case as you mentioned and probably not worth muddying up dead set because of it. If we decide to eventually send these to the dead set, the change will be add on #91 easily.
from verk.
Related Issues (20)
- Strange behaviour with integer argument, potential bug HOT 17
- Add mix task to reset queues HOT 9
- Add pending jobs to queue stats HOT 2
- Unable to overwrite `max_retry_count` via config.exs HOT 2
- Event for dead job HOT 2
- Question. Can Verk check more frequently for new jobs? HOT 2
- Undocumented `max_dead_jobs` HOT 1
- function Verk.Supervisor.start_link/1 is undefined or private HOT 3
- Im surely missing something. HOT 4
- Coupling of producers and consumers? HOT 1
- Upgrade GenStage to current version HOT 5
- Version Conflict with Confex 3.4.0 HOT 2
- Loosen dependency on redis HOT 2
- Verk 2.0 HOT 12
- Skip queuing jobs during tests. HOT 1
- Batch processing? HOT 2
- Defining contextual data for worker processes HOT 4
- [question] What are the risks of the "experimental" generate_node_id feature? HOT 4
- How do I setup Verk as a producer only? HOT 1
- Connect to Redix via ipv6? HOT 1
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 verk.