3 ms·
Is it at-most once delivery? how do you deal with crashes?
by avinassh 4y ago
Is it at-most once delivery? how do you deal with crashes?
- welder 4y agoWakaQ re-forks workers that crash, but normally a crash means an exception was raised in application task code. I do a combination of a few things to handle exceptions in tasks: 1. `@wakaq.task(max_retries=X)` auto retries the task on soft timeouts, which are usually intermittent and faster the second time the task runs 2. use error handling to track task failure rates https://gist.github.com/alanhamlett/365d48276ac054ae75e595256a7814f7 https://gist.github.com/alanhamlett/365d48276ac054ae75e59525... 3. build tasks to expect some failures by being safe to re-run without, for ex: sending an email twice. this usually means exclusive locking in tasks or keeping counters of recent task runs or task progress somewhere 4. try catch blocks inside tasks, which rollback and re-enqueue the same task to retry later Basically I handle all crashes at the application task level, not in WakaQ.
- avinassh 4y agoThank you for explaining! I think this should part of the README. I am going through the code and loving the simplicity of it!