Chapter 2Handle Failures by Planning Ahead
When a user is on your website or app and something goes wrong—even if it’s not something you expected to fail—the user will often retry what they were doing. If the underlying problem was transient, say their internet connection momentarily dropped, the retry will succeed and all is well (outside of a minor annoyance).
Your Sidekiq jobs don’t have a patient user hanging around willing to retry when things go wrong. Even if they did, there’s no guarantee that retrying the jobs will fix any underlying causes for failure (of which there are many). Nevertheless, your code needs to run to completion and you have to have some strategy to deal with failures. That’s what you’ll learn about here.
You’ll ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access