I’m working on importing Google Analytics data into Plausible Analytics. We use Oban for background jobs.
The import can be fairly flaky due to Google Analytics API timeouts. I thought I would make the job retry 5 times before reporting a failure to the user. Here’s my attempt:
When I test this locally, the job makes one attempt but never starts a second attempt. After the first attempt fails the job ends up in the following state:
Also @sorentwo do you accept sponsorships? I’d like to pay for Oban but since Plausible is AGPL, we cannot use commercially licensed code (Oban Web+Pro) within our product.
Plausible is a great open-source Elixir app and we’re happy Plausible customers, I’m happy to help
Retries are essentially scheduled jobs. The stager plugin transitions jobs from scheduled or retryable to available for execution, and it also notifies the appropriate queues that they have jobs to run. It doesn’t matter which queues are configured, the stager checks all jobs purely by state.
Nine out of ten times when this happens it’s because Postgres Pub/Sub isn’t working. The other one in ten it’s because of a stuck transaction that prevents the stager from running again. I recommend upgrading to Oban v2.11.2+ because it has changes to combat either of the scenarios I shared:
It uses centralized leadership to avoid using transactional locks to coordinate schedulers
It adds a new PG based notifier for environments that can’t use Postgres for Pub/Sub
Thanks for asking. We don’t have a pure sponsorship mechanism, but you’re welcome to support the project with a Web/Pro license and not use the packages