You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, documentation about UniqueOpts is stale for ByState condition:
// Warning: Removing any states from the default list (other than `retryable`)
// forces a fallback to a slower insertion path that takes an advisory lock
// and performs a look up before insertion. This path is deprecated and should
// be avoided if possible.
I got an error that pending and running is missing. Looking at the code it looks like this deprecated path has been removed in #614, but docstrings has not been updated.
BTW, I am sad that it is not possible to remove "running" state because now I cannot encode my use case. I have a bridge indexing data from PostgreSQL to ElasticSearch and in some cases I have to index additional documents. So I write their IDs into a table and submit a job to a single worker queue which then loops and reads from the table and process IDs in there until they are all indexed. So during this processing, more document IDs might be written into a table. Maybe current job will pick it up or maybe current job will skip it. This is why I want that it is possible to schedule additional but only one more job after currently running, so that after current job finishes, another one tries to do more work. So I would like to have ByState without "running" option.
Ack on running state: unfortunately as implemented, not requiring these states puts River in some pretty sticky situations when trying to move jobs between common parts of the runner state machine and finding a unique conflict already there. It's potentially resolvable, but maybe not an acceptable level of comprehensibility/complexity.
I wrote my comment in #1179. TLDR: as a user I am surprised that InsertOpts control anything else besides inserting. I would expect that it controls only inserting and not also impose restrictions on state transitioning.
Activity
Correct documentation on `UniqueOpts.ByState`
brandur commentedon Mar 23, 2026
Thanks. Fixed in #1179.
Ack on
runningstate: unfortunately as implemented, not requiring these states puts River in some pretty sticky situations when trying to move jobs between common parts of the runner state machine and finding a unique conflict already there. It's potentially resolvable, but maybe not an acceptable level of comprehensibility/complexity.mitar commentedon Mar 23, 2026
I wrote my comment in #1179. TLDR: as a user I am surprised that
InsertOptscontrol anything else besides inserting. I would expect that it controls only inserting and not also impose restrictions on state transitioning.Correct documentation on `UniqueOpts.ByState`
Correct documentation on `UniqueOpts.ByState` (#1179)