Repository navigation
Comparing changes
Open a pull request
base repository: rails/solid_queue
base: v1.7.1
head repository: rails/solid_queue
compare: v1.7.2
- 6 commits
- 10 files changed
- 2 contributors
Commits on Nov 3, 2026
-
Give concurrency slots back only to the semaphore they came from
A semaphore counts free slots but doesn't know which jobs hold them, so any job that gave a slot back by key counted as a holder: - A job that ran past its duration gave its slot back to the semaphore created after its own expired, letting another job start while the new holder was still running (#827). - A job dispatched while its class was missing skipped its limits, but gave a slot back if it later ran where its class loads. - A job whose class was missing when it ran couldn't give back the slot it got when it was dispatched (#825). Now a job records the id of the semaphore it got a slot on, and its limit, in its serialized Active Job data, and gives the slot back only to that semaphore. A job that skips its limits records that it holds no slot. Jobs that got their slot before this change have nothing recorded and keep giving it back by key, until 2.0. The first two tests come from the reproduction in #827. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 62c2927 - Browse repository at this point
Copy the full SHA 62c2927View commit details -
Read the acquired semaphore with a lock, and record the limit used
On MySQL with REPEATABLE READ, a plain read after taking a slot uses the transaction's snapshot, which can still include a semaphore that expired and was deleted after the snapshot was taken, so the job could record that one instead of the semaphore it just created. A locking read sees the latest committed rows. A job that keeps its concurrency key after its class drops limits_concurrency takes its slot with a limit of 1, so record that rather than nil, which failed to give the slot back if the class was also missing when the job ran. Also cover jobs sharing a semaphore, discarding ready jobs one by one and in bulk, and retried jobs, and explain the change in UPGRADING. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 50ca656 - Browse repository at this point
Copy the full SHA 50ca656View commit details -
Place the semaphore note under 1.7.2 in UPGRADING
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6af5101 - Browse repository at this point
Copy the full SHA 6af5101View commit details -
Test that a job records the semaphore it created on MySQL, and correc…
…t the upgrade note A plain read inside a REPEATABLE READ transaction can still see a semaphore deleted after the transaction's snapshot, so without the locking read the job would record that one. The test fails without it. A slot that isn't given back comes back only when its semaphore expires, and every job taking or giving back a slot for the same key pushes that out, so on a busy key with a limit above 1 it may not come back for a long time. Say so in UPGRADING instead of promising it comes back after duration. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 310496a - Browse repository at this point
Copy the full SHA 310496aView commit details -
Let the job answer for the concurrency slot it holds
concurrency_limited? now just means the job has a concurrency key, as on the Active Job side, and the code checks for a missing class where that matters. The job exposes the semaphore it got its slot from and the limit it got it with, so the semaphore asks for those instead of reading the recorded data itself. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8b2a87b - Browse repository at this point
Copy the full SHA 8b2a87bView commit details -
Configuration menu - View commit details
-
Copy full SHA for b9c646a - Browse repository at this point
Copy the full SHA b9c646aView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v1.7.1...v1.7.2