Comments (5)
Thanks for the report @tombh
from rihanna.
I'm getting this too after updating to the latest version.
Unsure what the problem is here, but there's very little code to explore!
from rihanna.
@lpil I'm not certain this issue is resolved. I'm still getting a boatload of these errors in production with version 1.3.5
. All coming with a similar stacktrace to what @tombh mentioned, following a mark_successful
.
from rihanna.
Actually... chalk this one up to novice DBA-ing right here. I'm gonna leave my notes in case anyone else runs into this.
Short answer: Advisory locks were sometimes not being held onto because of my pg_bouncer
connection pool settings, leading to the following symptoms:
- An inordinate number of multiply-executed jobs
- Jobs being "orphaned" in the database with no
failed_at
but seemingly being "skipped over" by the workers (...because the DB was holding a lock for a process that didn't close it) - The error @tombh mentioned above showing up in logs from
Rihanna.Job.release_lock/2
My solution was specific to my DBaaS provider (Digital Ocean), and may be translate-able to other scenarios:
- The default
Pooling Mode
for pg_bouncer was set to Transaction Mode, which I believe is what was causing the orphaning above - In the text for my seemingly-successful switch, Session Mode, their documentation states:
Session mode is useful when your application uses prepared statements, advisory locks, listen/notify, or other features which operate on a session level rather than a transaction level.
...which has seemed to me to be the key here.
I'm not certain this is the fix. But it seems to be working at the moment. If this is an uncommon occurrence, then my note here may help folks out. And if it's something we suspect folks might run into with other DB providers, maybe there's room to flag it as a gotcha for folks in documentation?
from rihanna.
@lperiodbose Yup when I saw this my first thought was pgbouncer, which would break any application that relies on advisory locks.
Would love to see a PR adding this to the README or similar!
from rihanna.
Related Issues (20)
- Not execute in test sandbox ? HOT 1
- Running on many apps in an umbrella HOT 6
- Running N instances of rihanna on different tables HOT 2
- UndefinedFunctionError: function nil.id/0 is undefined HOT 3
- Question: Projection on when multi-queue support will be a thing? HOT 8
- Re-enqueue and retain metadata
- Should due_at be part of the order in the lock query? HOT 2
- Rihanna.Jobs documentation issue
- ERROR 25006 (read_only_sql_transaction) cannot execute SELECT FOR UPDATE in a read-only transaction HOT 2
- Returning {:reenqueue, due_at} from job removes job from table HOT 3
- lock optimization for very large jobs table. Possible?! HOT 10
- Report job type (e.g. module name) in Telemetry events HOT 6
- Jobs that unexpectedly raise/exit are never retried HOT 1
- Rihanna Jobs sporadically not appearing in logs HOT 2
- Upgrade checks fail when database has multiple schemas & job tables
- Warnings on 1.11.4
- Rihanna.enqueue_many ? HOT 2
- Option to create the jobs_table_name on a different schema
- Any chance of a version bump / release with the latest changes? HOT 2
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 rihanna.