Repository navigation
fix(subscriber): avoid savepoint collisions when completing requests - #3630
Conversation
A batched save fires MediaRequestSubscriber.afterUpdate for every request concurrently, and each opens a nested transaction on the same query runner. On Postgres the concurrent savepoints collide, aborting the outer transaction and returning the connection to the pool in a broken state. fix #3365
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
When a media item became available, every related request was completed with a single batched save. TypeORM then ran each request's afterUpdate subscriber concurrently on the same connection, and the concurrent savepoints could collide. Save the requests sequentially instead. Ported from seerr-team/seerr#3630. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…2) (#1708) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ghcr.io/seerr-team/seerr](https://github.com/seerr-team/seerr) | patch | `v3.5.1` → `v3.5.2` | --- ### Release Notes <details> <summary>seerr-team/seerr (ghcr.io/seerr-team/seerr)</summary> ### [`v3.5.2`](https://github.com/seerr-team/seerr/releases/tag/v3.5.2) [Compare Source](seerr-team/seerr@v3.5.1...v3.5.2) ##### [3.5.2](https://github.com/seerr-team/seerr/compare/v3.5.1..v3.5.2) - 2026-11-12 ##### 🐛 Bug Fixes - *(JellyfinAPI)* Filter episodes by requested season ID ([#​3697](seerr-team/seerr#3697)) - ([7bfc90f](seerr-team/seerr@7bfc90f)) - *(api)* Stop background cache refresh from logging credentials ([#​3699](seerr-team/seerr#3699)) - ([3f7d5c3](seerr-team/seerr@3f7d5c3)) - *(api)* Correct watchlist POST request schema in OpenAPI spec ([#​3425](seerr-team/seerr#3425)) - ([84ed3c1](seerr-team/seerr@84ed3c1)) - *(auth)* Set mediaServerType on plex login with existing users ([#​3652](seerr-team/seerr#3652)) - ([84eae67](seerr-team/seerr@84eae67)) - *(auth)* Treat intermittent plex.tv PIN 404s as transient ([#​3599](seerr-team/seerr#3599)) - ([9e2021b](seerr-team/seerr@9e2021b)) - *(details)* Download polling and manage panel close ([#​3676](seerr-team/seerr#3676)) - ([debd54d](seerr-team/seerr@debd54d)) - *(discord)* Link webhook URL label to its field ([#​3702](seerr-team/seerr#3702)) - ([8331f36](seerr-team/seerr@8331f36)) - *(discover)* Preserve trending filters on back navigation ([#​3608](seerr-team/seerr#3608)) - ([efbc937](seerr-team/seerr@efbc937)) - *(jellyfin)* Handle season and episode items in recently added scan ([#​3551](seerr-team/seerr#3551)) - ([cd8aa1f](seerr-team/seerr@cd8aa1f)) - *(jobs)* Use minute intervals for the plex watchlist sync schedule ([#​3593](seerr-team/seerr#3593)) - ([6370562](seerr-team/seerr@6370562)) - *(migrations)* Use literals for new columns in SQLite table-copy migrations ([#​3695](seerr-team/seerr#3695)) - ([58318ec](seerr-team/seerr@58318ec)) - *(override-rules)* Apply rules for the requested server ([#​3538](seerr-team/seerr#3538)) - ([c57dca9](seerr-team/seerr@c57dca9)) - *(plex)* Do not cache invalid Discover watchlist responses ([#​3406](seerr-team/seerr#3406)) - ([9a5c89f](seerr-team/seerr@9a5c89f)) - *(radarr)* Initiate Radarr movie search only if movie is available ([#​3533](seerr-team/seerr#3533)) - ([978f437](seerr-team/seerr@978f437)) - *(request)* Enforce advanced request permission on the API ([#​3674](seerr-team/seerr#3674)) - ([af03562](seerr-team/seerr@af03562)) - *(requests)* Handle 202 no-seasons response in TV request modal ([#​3573](seerr-team/seerr#3573)) - ([d09072a](seerr-team/seerr@d09072a)) - *(requests)* Sort requests by creation date instead of just id ([#​3589](seerr-team/seerr#3589)) - ([53e4564](seerr-team/seerr@53e4564)) - *(scanners)* Resolve abandoned seasons at end of run ([#​3579](seerr-team/seerr#3579)) - ([b185621](seerr-team/seerr@b185621)) - *(scanners)* Decline request when media resets to UNKNOWN ([#​3578](seerr-team/seerr#3578)) - ([8f2ecee](seerr-team/seerr@8f2ecee)) - *(settings)* Allow trailing slash in YouTube URL ([#​3557](seerr-team/seerr#3557)) - ([e959062](seerr-team/seerr@e959062)) - *(slack)* Link notification settings labels to their fields ([#​3679](seerr-team/seerr#3679)) - ([886adac](seerr-team/seerr@886adac)) - *(subscriber)* Avoid savepoint collisions when completing requests ([#​3630](seerr-team/seerr#3630)) - ([31b100d](seerr-team/seerr@31b100d)) ##### 📖 Documentation - *(notifications)* Document missing fields on the remaining agent pages ([#​3611](seerr-team/seerr#3611)) - ([c167958](seerr-team/seerr@c167958)) - *(telegram)* Document the Thread/Topic ID and Embed Poster settings ([#​3550](seerr-team/seerr#3550)) - ([14ed03d](seerr-team/seerr@14ed03d)) - Clarify AI policy, add review times, update branch naming ([#​3636](seerr-team/seerr#3636)) - ([63f4663](seerr-team/seerr@63f4663)) - Add a warning about new contribution scope ([#​3595](seerr-team/seerr#3595)) - ([1406e6e](seerr-team/seerr@1406e6e)) - Fix backups menu ([#​3575](seerr-team/seerr#3575)) - ([2cfbcf8](seerr-team/seerr@2cfbcf8)) ##### 🧪 Testing - *(cypress)* Fix watchlist and manage panel flakes ([#​3675](seerr-team/seerr#3675)) - ([f80beb9](seerr-team/seerr@f80beb9)) - *(cypress)* Fix flaky keyword spec and keep only failure videos ([#​3649](seerr-team/seerr#3649)) - ([b4ea6e8](seerr-team/seerr@b4ea6e8)) ##### ⚙️ Miscellaneous Tasks - *(actions)* Update dependency ubuntu to v26 ([#​3638](seerr-team/seerr#3638)) - ([3153656](seerr-team/seerr@3153656)) - *(cypress)* Fix paths filter and bump github-action to v7.4.6 ([#​3648](seerr-team/seerr#3648)) - ([f288fff](seerr-team/seerr@f288fff)) - *(devenv)* Update dependencies ([#​3631](seerr-team/seerr#3631)) - ([6f63b08](seerr-team/seerr@6f63b08)) - *(docker)* Update node.js to v22.23.5 ([#​3711](seerr-team/seerr#3711)) - ([d19d50e](seerr-team/seerr@d19d50e)) - *(docker)* Update node.js to v22.23.4 ([#​3639](seerr-team/seerr#3639)) - ([0b27912](seerr-team/seerr@0b27912)) - *(git-cliff)* Add build type to miscellaneous tasks ([#​3640](seerr-team/seerr#3640)) - ([62ed636](seerr-team/seerr@62ed636)) - *(i18n)* Update translations from Weblate - ([854effb](seerr-team/seerr@854effb)) - *(i18n)* Update translations from Weblate - ([b4b85dc](seerr-team/seerr@b4b85dc)) - *(i18n)* Update translations from Weblate - ([381ce98](seerr-team/seerr@381ce98)) - *(i18n)* Update translations from Weblate - ([dca1af6](seerr-team/seerr@dca1af6)) - *(i18n)* Update translations from Weblate - ([1313800](seerr-team/seerr@1313800)) - *(i18n)* Update translations from Weblate - ([f88515b](seerr-team/seerr@f88515b)) - *(pr-validation)* Exempt maintainers by repo permission level ([#​3637](seerr-team/seerr#3637)) - ([f9fe7a9](seerr-team/seerr@f9fe7a9)) - *(release)* Prepare v3.5.2 - ([18a90b4](seerr-team/seerr@18a90b4)) - *(release)* Prepare 3.5.2 release - ([1889c6a](seerr-team/seerr@1889c6a)) - Migrate to gh actions-lock ([#​3632](seerr-team/seerr#3632)) - ([53299c1](seerr-team/seerr@53299c1)) - Add vulnerability report ([#​3587](seerr-team/seerr#3587)) - ([e00d685](seerr-team/seerr@e00d685)) ##### New Contributors ❤️ - [@​thirstyraven](https://github.com/thirstyraven) made their first contribution - [@​jkhsjdhjs](https://github.com/jkhsjdhjs) made their first contribution - [@​pattems](https://github.com/pattems) made their first contribution - [@​rpardini](https://github.com/rpardini) made their first contribution - [@​cplieger](https://github.com/cplieger) made their first contribution - [@​kinn81](https://github.com/kinn81) made their first contribution - [@​scottfridwin](https://github.com/scottfridwin) made their first contribution - [@​BBijaya](https://github.com/BBijaya) made their first contribution </details> --- ### Configuration 📅 **Schedule**: (in timezone Europe/Berlin) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yMjEuNiIsInVwZGF0ZWRJblZlciI6IjQ0LjIyMS42IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19--> Reviewed-on: https://git.xcd.dev/gabrielcosi/home-ops/pulls/1708
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [seerr/seerr](https://github.com/seerr-team/seerr) | patch | `v3.5.1` → `v3.5.2` | --- ### Release Notes <details> <summary>seerr-team/seerr (seerr/seerr)</summary> ### [`v3.5.2`](https://github.com/seerr-team/seerr/releases/tag/v3.5.2) [Compare Source](seerr-team/seerr@v3.5.1...v3.5.2) > \[!WARNING] > **This release fixes 3 security vulnerabilities. All users should update to 3.5.2 as soon as possible.** > > To give everyone time to upgrade, full details will be published as security advisories on **November 15, 2026**. Once published, the details will be public, so update now rather than waiting for the advisories. > > These release notes will be updated with links to the advisories once they're published. ##### 🐛 Bug Fixes - *(JellyfinAPI)* Filter episodes by requested season ID ([#​3697](seerr-team/seerr#3697)) - ([7bfc90f](seerr-team/seerr@7bfc90f)) - *(api)* Stop background cache refresh from logging credentials ([#​3699](seerr-team/seerr#3699)) - ([3f7d5c3](seerr-team/seerr@3f7d5c3)) - *(api)* Correct watchlist POST request schema in OpenAPI spec ([#​3425](seerr-team/seerr#3425)) - ([84ed3c1](seerr-team/seerr@84ed3c1)) - *(auth)* Set mediaServerType on plex login with existing users ([#​3652](seerr-team/seerr#3652)) - ([84eae67](seerr-team/seerr@84eae67)) - *(auth)* Treat intermittent plex.tv PIN 404s as transient ([#​3599](seerr-team/seerr#3599)) - ([9e2021b](seerr-team/seerr@9e2021b)) - *(details)* Download polling and manage panel close ([#​3676](seerr-team/seerr#3676)) - ([debd54d](seerr-team/seerr@debd54d)) - *(discord)* Link webhook URL label to its field ([#​3702](seerr-team/seerr#3702)) - ([8331f36](seerr-team/seerr@8331f36)) - *(discover)* Preserve trending filters on back navigation ([#​3608](seerr-team/seerr#3608)) - ([efbc937](seerr-team/seerr@efbc937)) - *(jellyfin)* Handle season and episode items in recently added scan ([#​3551](seerr-team/seerr#3551)) - ([cd8aa1f](seerr-team/seerr@cd8aa1f)) - *(jobs)* Use minute intervals for the plex watchlist sync schedule ([#​3593](seerr-team/seerr#3593)) - ([6370562](seerr-team/seerr@6370562)) - *(migrations)* Use literals for new columns in SQLite table-copy migrations ([#​3695](seerr-team/seerr#3695)) - ([58318ec](seerr-team/seerr@58318ec)) - *(override-rules)* Apply rules for the requested server ([#​3538](seerr-team/seerr#3538)) - ([c57dca9](seerr-team/seerr@c57dca9)) - *(plex)* Do not cache invalid Discover watchlist responses ([#​3406](seerr-team/seerr#3406)) - ([9a5c89f](seerr-team/seerr@9a5c89f)) - *(radarr)* Initiate Radarr movie search only if movie is available ([#​3533](seerr-team/seerr#3533)) - ([978f437](seerr-team/seerr@978f437)) - *(request)* Enforce advanced request permission on the API ([#​3674](seerr-team/seerr#3674)) - ([af03562](seerr-team/seerr@af03562)) - *(requests)* Handle 202 no-seasons response in TV request modal ([#​3573](seerr-team/seerr#3573)) - ([d09072a](seerr-team/seerr@d09072a)) - *(requests)* Sort requests by creation date instead of just id ([#​3589](seerr-team/seerr#3589)) - ([53e4564](seerr-team/seerr@53e4564)) - *(scanners)* Resolve abandoned seasons at end of run ([#​3579](seerr-team/seerr#3579)) - ([b185621](seerr-team/seerr@b185621)) - *(scanners)* Decline request when media resets to UNKNOWN ([#​3578](seerr-team/seerr#3578)) - ([8f2ecee](seerr-team/seerr@8f2ecee)) - *(settings)* Allow trailing slash in YouTube URL ([#​3557](seerr-team/seerr#3557)) - ([e959062](seerr-team/seerr@e959062)) - *(slack)* Link notification settings labels to their fields ([#​3679](seerr-team/seerr#3679)) - ([886adac](seerr-team/seerr@886adac)) - *(subscriber)* Avoid savepoint collisions when completing requests ([#​3630](seerr-team/seerr#3630)) - ([31b100d](seerr-team/seerr@31b100d)) ##### 📖 Documentation - *(notifications)* Document missing fields on the remaining agent pages ([#​3611](seerr-team/seerr#3611)) - ([c167958](seerr-team/seerr@c167958)) - *(telegram)* Document the Thread/Topic ID and Embed Poster settings ([#​3550](seerr-team/seerr#3550)) - ([14ed03d](seerr-team/seerr@14ed03d)) - Clarify AI policy, add review times, update branch naming ([#​3636](seerr-team/seerr#3636)) - ([63f4663](seerr-team/seerr@63f4663)) - Add a warning about new contribution scope ([#​3595](seerr-team/seerr#3595)) - ([1406e6e](seerr-team/seerr@1406e6e)) - Fix backups menu ([#​3575](seerr-team/seerr#3575)) - ([2cfbcf8](seerr-team/seerr@2cfbcf8)) ##### 🧪 Testing - *(cypress)* Fix watchlist and manage panel flakes ([#​3675](seerr-team/seerr#3675)) - ([f80beb9](seerr-team/seerr@f80beb9)) - *(cypress)* Fix flaky keyword spec and keep only failure videos ([#​3649](seerr-team/seerr#3649)) - ([b4ea6e8](seerr-team/seerr@b4ea6e8)) ##### ⚙️ Miscellaneous Tasks - *(actions)* Update dependency ubuntu to v26 ([#​3638](seerr-team/seerr#3638)) - ([3153656](seerr-team/seerr@3153656)) - *(cypress)* Fix paths filter and bump github-action to v7.4.6 ([#​3648](seerr-team/seerr#3648)) - ([f288fff](seerr-team/seerr@f288fff)) - *(devenv)* Update dependencies ([#​3631](seerr-team/seerr#3631)) - ([6f63b08](seerr-team/seerr@6f63b08)) - *(docker)* Update node.js to v22.23.5 ([#​3711](seerr-team/seerr#3711)) - ([d19d50e](seerr-team/seerr@d19d50e)) - *(docker)* Update node.js to v22.23.4 ([#​3639](seerr-team/seerr#3639)) - ([0b27912](seerr-team/seerr@0b27912)) - *(git-cliff)* Add build type to miscellaneous tasks ([#​3640](seerr-team/seerr#3640)) - ([62ed636](seerr-team/seerr@62ed636)) - *(i18n)* Update translations from Weblate - ([854effb](seerr-team/seerr@854effb)) - *(i18n)* Update translations from Weblate - ([b4b85dc](seerr-team/seerr@b4b85dc)) - *(i18n)* Update translations from Weblate - ([381ce98](seerr-team/seerr@381ce98)) - *(i18n)* Update translations from Weblate - ([dca1af6](seerr-team/seerr@dca1af6)) - *(i18n)* Update translations from Weblate - ([1313800](seerr-team/seerr@1313800)) - *(i18n)* Update translations from Weblate - ([f88515b](seerr-team/seerr@f88515b)) - *(pr-validation)* Exempt maintainers by repo permission level ([#​3637](seerr-team/seerr#3637)) - ([f9fe7a9](seerr-team/seerr@f9fe7a9)) - *(release)* Prepare v3.5.2 - ([18a90b4](seerr-team/seerr@18a90b4)) - *(release)* Prepare 3.5.2 release - ([1889c6a](seerr-team/seerr@1889c6a)) - Migrate to gh actions-lock ([#​3632](seerr-team/seerr#3632)) - ([53299c1](seerr-team/seerr@53299c1)) - Add vulnerability report ([#​3587](seerr-team/seerr#3587)) - ([e00d685](seerr-team/seerr@e00d685)) ##### New Contributors ❤️ - [@​thirstyraven](https://github.com/thirstyraven) made their first contribution - [@​jkhsjdhjs](https://github.com/jkhsjdhjs) made their first contribution - [@​pattems](https://github.com/pattems) made their first contribution - [@​rpardini](https://github.com/rpardini) made their first contribution - [@​cplieger](https://github.com/cplieger) made their first contribution - [@​kinn81](https://github.com/kinn81) made their first contribution - [@​scottfridwin](https://github.com/scottfridwin) made their first contribution - [@​BBijaya](https://github.com/BBijaya) made their first contribution </details> --- ### Configuration 📅 **Schedule**: (in timezone America/New_York) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yMjIuNSIsInVwZGF0ZWRJblZlciI6IjQ0LjIyMi41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19--> Reviewed-on: https://git.greyrock.io/todd/home-ops/pulls/745
Description
When a show has two or more separate approved requests and all of their seasons become available in a single update, the completed requests were saved in one batch. TypeORM runs the request subscriber for every entity in a batch concurrently, and each run opens a nested transaction on the same connection.
On Postgres those concurrent savepoints collide, which aborts the outer transaction so the status changes don't stick, and the connection is returned to the pool still inside the aborted transaction, so unrelated because nested transactions don't use savepoints there.
The completed requests are now saved one at a time, the same way the season requests just above them already are.
This is a regression from #3366.
How Has This Been Tested?
Reproduced against a fresh PostgreSQL database (on develop, with a
DB_POOL_SIZE=2) with a script that seeds a show with S1 and S2 processing and two separate approved requests, one per season, then marks the show and both seasons available in a single save.savepoint "typeorm_3" does not exist, the outer transaction aborts, the show stays processing and both requests stay approved, and later queries on the same pooled connection fail withcurrent transaction is aborted.To test in the UI on PostgreSQL:
Before this change the logs show
savepoint "typeorm_N" does not existand the status doesn't stick. With it, the show is available and both requests are completed. This can be tested using the image tag:preview-pgsql-savepoint-fixScreenshots / Logs (if applicable)
PostgreSQL query log, before and after
Before (develop):
After:
Checklist:
pnpm buildpnpm i18n:extractSummary by CodeRabbit