RC2 LimitedConcurrencyLibraryScheduler 'database is locked' #7133

Closed
opened 2026-02-07 04:37:07 +03:00 by OVERLORD · 13 comments
Owner

Originally created by @ptr727 on GitHub (Jul 1, 2025).

Description of the bug

Installed fresh new JF docker RC2, added movie library, observe lots of 'database is locked' errors on log.

E.g.

[2025-06-30 17:24:02.113 -07:00] [ERR] [51] MediaBrowser.Controller.LibraryTaskScheduler.LimitedConcurrencyLibraryScheduler: Error while performing a library operation
Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 5: 'database is locked'.
   at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
   at Microsoft.Data.Sqlite.SqliteConnectionExtensions.ExecuteNonQuery(SqliteConnection connection, String commandText, SqliteParameter[] parameters)
   at Microsoft.Data.Sqlite.SqliteTransaction..ctor(SqliteConnection connection, IsolationLevel isolationLevel, Boolean deferred)
   at Microsoft.Data.Sqlite.SqliteConnection.BeginTransaction(IsolationLevel isolationLevel, Boolean deferred)
   at Microsoft.Data.Sqlite.SqliteConnection.BeginTransaction(IsolationLevel isolationLevel)
   at Microsoft.Data.Sqlite.SqliteConnection.BeginDbTransaction(IsolationLevel isolationLevel)
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.ConnectionBeginTransaction(IsolationLevel isolationLevel)
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.BeginTransaction(IsolationLevel isolationLevel)
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.BeginTransaction()
   at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.BeginTransaction()
   at Jellyfin.Server.Implementations.Item.BaseItemRepository.UpdateOrInsertItems(IReadOnlyList`1 items, CancellationToken cancellationToken)
   at Jellyfin.Server.Implementations.Item.BaseItemRepository.SaveItems(IReadOnlyList`1 items, CancellationToken cancellationToken)
   at Emby.Server.Implementations.Library.LibraryManager.UpdateItemsAsync(IReadOnlyList`1 items, BaseItem parent, ItemUpdateType updateReason, CancellationToken cancellationToken)
   at MediaBrowser.Controller.Entities.BaseItem.UpdateToRepositoryAsync(ItemUpdateType updateReason, CancellationToken cancellationToken)
   at MediaBrowser.Controller.Entities.Video.UpdateToRepositoryAsync(ItemUpdateType updateReason, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Manager.MetadataService`2.SaveItemAsync(MetadataResult`1 result, ItemUpdateType reason, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Manager.MetadataService`2.<RefreshMetadata>g__SaveInternal|36_0(BaseItem item, MetadataRefreshOptions refreshOptions, ItemUpdateType updateType, Boolean isFirstRefresh, Boolean requiresRefresh, MetadataResult`1 metadataResult, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Manager.MetadataService`2.RefreshMetadata(BaseItem item, MetadataRefreshOptions refreshOptions, CancellationToken cancellationToken)
   at MediaBrowser.Controller.Entities.BaseItem.RefreshMetadata(MetadataRefreshOptions options, CancellationToken cancellationToken)
   at MediaBrowser.Controller.Entities.Folder.RefreshChildMetadata(BaseItem child, MetadataRefreshOptions refreshOptions, Boolean recursive, IProgress`1 progress, CancellationToken cancellationToken)
   at MediaBrowser.Controller.LibraryTaskScheduler.LimitedConcurrencyLibraryScheduler.ProcessItem(TaskQueueItem item)

Reproduction steps

  • Create new JF docker compose using docker.io/jellyfin/jellyfin:10.11.0-rc2.
  • Open web browser and do initial setup.
  • Add a movie library.
  • Observe lots of errors in the logs.

What is the current bug behavior?

DB locked errors in logs.

What is the expected correct behavior?

No DB errors.

Jellyfin Server version

Master

Specify commit id

No response

Specify unstable release number

RC2

Specify version number

No response

Specify the build version

10.11.0-rc2

Environment

- OS: Proxmox / Debian
- Linux Kernel: 6.8.12-11-pve
- Virtualization: No
- Clients: Web
- Browser: Chrome
- FFmpeg Version:
- Playback Method:
- Hardware Acceleration:
- GPU Model:
- Plugins:
- Reverse Proxy:
- Base URL:
- Networking: macvlan
- Jellyfin Data Storage: ZFS
- Media Storage: ZFS
- External Integrations:

Jellyfin logs

[2025-06-30 17:24:02.113 -07:00] [ERR] [51] MediaBrowser.Controller.LibraryTaskScheduler.LimitedConcurrencyLibraryScheduler: Error while performing a library operation
Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 5: 'database is locked'.
   at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
   at Microsoft.Data.Sqlite.SqliteConnectionExtensions.ExecuteNonQuery(SqliteConnection connection, String commandText, SqliteParameter[] parameters)
   at Microsoft.Data.Sqlite.SqliteTransaction..ctor(SqliteConnection connection, IsolationLevel isolationLevel, Boolean deferred)
   at Microsoft.Data.Sqlite.SqliteConnection.BeginTransaction(IsolationLevel isolationLevel, Boolean deferred)
   at Microsoft.Data.Sqlite.SqliteConnection.BeginTransaction(IsolationLevel isolationLevel)
   at Microsoft.Data.Sqlite.SqliteConnection.BeginDbTransaction(IsolationLevel isolationLevel)
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.ConnectionBeginTransaction(IsolationLevel isolationLevel)
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.BeginTransaction(IsolationLevel isolationLevel)
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.BeginTransaction()
   at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.BeginTransaction()
   at Jellyfin.Server.Implementations.Item.BaseItemRepository.UpdateOrInsertItems(IReadOnlyList`1 items, CancellationToken cancellationToken)
   at Jellyfin.Server.Implementations.Item.BaseItemRepository.SaveItems(IReadOnlyList`1 items, CancellationToken cancellationToken)
   at Emby.Server.Implementations.Library.LibraryManager.UpdateItemsAsync(IReadOnlyList`1 items, BaseItem parent, ItemUpdateType updateReason, CancellationToken cancellationToken)
   at MediaBrowser.Controller.Entities.BaseItem.UpdateToRepositoryAsync(ItemUpdateType updateReason, CancellationToken cancellationToken)
   at MediaBrowser.Controller.Entities.Video.UpdateToRepositoryAsync(ItemUpdateType updateReason, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Manager.MetadataService`2.SaveItemAsync(MetadataResult`1 result, ItemUpdateType reason, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Manager.MetadataService`2.<RefreshMetadata>g__SaveInternal|36_0(BaseItem item, MetadataRefreshOptions refreshOptions, ItemUpdateType updateType, Boolean isFirstRefresh, Boolean requiresRefresh, MetadataResult`1 metadataResult, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Manager.MetadataService`2.RefreshMetadata(BaseItem item, MetadataRefreshOptions refreshOptions, CancellationToken cancellationToken)
   at MediaBrowser.Controller.Entities.BaseItem.RefreshMetadata(MetadataRefreshOptions options, CancellationToken cancellationToken)
   at MediaBrowser.Controller.Entities.Folder.RefreshChildMetadata(BaseItem child, MetadataRefreshOptions refreshOptions, Boolean recursive, IProgress`1 progress, CancellationToken cancellationToken)
   at MediaBrowser.Controller.LibraryTaskScheduler.LimitedConcurrencyLibraryScheduler.ProcessItem(TaskQueueItem item)

FFmpeg logs


Client / Browser logs

No response

Relevant screenshots or videos

No response

Additional information

System is:
Supermicro H13SSL-N
AMD EPYC Genoa 9334 QS (32 x core, 64 x thread)
384GB RAM
ZFS on SSD's for config and cache, ZFS on spinning disks for media.

log_20250630.log

Originally created by @ptr727 on GitHub (Jul 1, 2025). ### Description of the bug Installed fresh new JF docker RC2, added movie library, observe lots of 'database is locked' errors on log. E.g. ```log [2025-06-30 17:24:02.113 -07:00] [ERR] [51] MediaBrowser.Controller.LibraryTaskScheduler.LimitedConcurrencyLibraryScheduler: Error while performing a library operation Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 5: 'database is locked'. at Microsoft.Data.Sqlite.SqliteDataReader.NextResult() at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior) at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery() at Microsoft.Data.Sqlite.SqliteConnectionExtensions.ExecuteNonQuery(SqliteConnection connection, String commandText, SqliteParameter[] parameters) at Microsoft.Data.Sqlite.SqliteTransaction..ctor(SqliteConnection connection, IsolationLevel isolationLevel, Boolean deferred) at Microsoft.Data.Sqlite.SqliteConnection.BeginTransaction(IsolationLevel isolationLevel, Boolean deferred) at Microsoft.Data.Sqlite.SqliteConnection.BeginTransaction(IsolationLevel isolationLevel) at Microsoft.Data.Sqlite.SqliteConnection.BeginDbTransaction(IsolationLevel isolationLevel) at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.ConnectionBeginTransaction(IsolationLevel isolationLevel) at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.BeginTransaction(IsolationLevel isolationLevel) at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.BeginTransaction() at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.BeginTransaction() at Jellyfin.Server.Implementations.Item.BaseItemRepository.UpdateOrInsertItems(IReadOnlyList`1 items, CancellationToken cancellationToken) at Jellyfin.Server.Implementations.Item.BaseItemRepository.SaveItems(IReadOnlyList`1 items, CancellationToken cancellationToken) at Emby.Server.Implementations.Library.LibraryManager.UpdateItemsAsync(IReadOnlyList`1 items, BaseItem parent, ItemUpdateType updateReason, CancellationToken cancellationToken) at MediaBrowser.Controller.Entities.BaseItem.UpdateToRepositoryAsync(ItemUpdateType updateReason, CancellationToken cancellationToken) at MediaBrowser.Controller.Entities.Video.UpdateToRepositoryAsync(ItemUpdateType updateReason, CancellationToken cancellationToken) at MediaBrowser.Providers.Manager.MetadataService`2.SaveItemAsync(MetadataResult`1 result, ItemUpdateType reason, CancellationToken cancellationToken) at MediaBrowser.Providers.Manager.MetadataService`2.<RefreshMetadata>g__SaveInternal|36_0(BaseItem item, MetadataRefreshOptions refreshOptions, ItemUpdateType updateType, Boolean isFirstRefresh, Boolean requiresRefresh, MetadataResult`1 metadataResult, CancellationToken cancellationToken) at MediaBrowser.Providers.Manager.MetadataService`2.RefreshMetadata(BaseItem item, MetadataRefreshOptions refreshOptions, CancellationToken cancellationToken) at MediaBrowser.Controller.Entities.BaseItem.RefreshMetadata(MetadataRefreshOptions options, CancellationToken cancellationToken) at MediaBrowser.Controller.Entities.Folder.RefreshChildMetadata(BaseItem child, MetadataRefreshOptions refreshOptions, Boolean recursive, IProgress`1 progress, CancellationToken cancellationToken) at MediaBrowser.Controller.LibraryTaskScheduler.LimitedConcurrencyLibraryScheduler.ProcessItem(TaskQueueItem item) ``` ### Reproduction steps - Create new JF docker compose using `docker.io/jellyfin/jellyfin:10.11.0-rc2`. - Open web browser and do initial setup. - Add a movie library. - Observe lots of errors in the logs. ### What is the current _bug_ behavior? DB locked errors in logs. ### What is the expected _correct_ behavior? No DB errors. ### Jellyfin Server version Master ### Specify commit id _No response_ ### Specify unstable release number RC2 ### Specify version number _No response_ ### Specify the build version 10.11.0-rc2 ### Environment ```markdown - OS: Proxmox / Debian - Linux Kernel: 6.8.12-11-pve - Virtualization: No - Clients: Web - Browser: Chrome - FFmpeg Version: - Playback Method: - Hardware Acceleration: - GPU Model: - Plugins: - Reverse Proxy: - Base URL: - Networking: macvlan - Jellyfin Data Storage: ZFS - Media Storage: ZFS - External Integrations: ``` ### Jellyfin logs ```shell [2025-06-30 17:24:02.113 -07:00] [ERR] [51] MediaBrowser.Controller.LibraryTaskScheduler.LimitedConcurrencyLibraryScheduler: Error while performing a library operation Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 5: 'database is locked'. at Microsoft.Data.Sqlite.SqliteDataReader.NextResult() at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior) at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery() at Microsoft.Data.Sqlite.SqliteConnectionExtensions.ExecuteNonQuery(SqliteConnection connection, String commandText, SqliteParameter[] parameters) at Microsoft.Data.Sqlite.SqliteTransaction..ctor(SqliteConnection connection, IsolationLevel isolationLevel, Boolean deferred) at Microsoft.Data.Sqlite.SqliteConnection.BeginTransaction(IsolationLevel isolationLevel, Boolean deferred) at Microsoft.Data.Sqlite.SqliteConnection.BeginTransaction(IsolationLevel isolationLevel) at Microsoft.Data.Sqlite.SqliteConnection.BeginDbTransaction(IsolationLevel isolationLevel) at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.ConnectionBeginTransaction(IsolationLevel isolationLevel) at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.BeginTransaction(IsolationLevel isolationLevel) at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.BeginTransaction() at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.BeginTransaction() at Jellyfin.Server.Implementations.Item.BaseItemRepository.UpdateOrInsertItems(IReadOnlyList`1 items, CancellationToken cancellationToken) at Jellyfin.Server.Implementations.Item.BaseItemRepository.SaveItems(IReadOnlyList`1 items, CancellationToken cancellationToken) at Emby.Server.Implementations.Library.LibraryManager.UpdateItemsAsync(IReadOnlyList`1 items, BaseItem parent, ItemUpdateType updateReason, CancellationToken cancellationToken) at MediaBrowser.Controller.Entities.BaseItem.UpdateToRepositoryAsync(ItemUpdateType updateReason, CancellationToken cancellationToken) at MediaBrowser.Controller.Entities.Video.UpdateToRepositoryAsync(ItemUpdateType updateReason, CancellationToken cancellationToken) at MediaBrowser.Providers.Manager.MetadataService`2.SaveItemAsync(MetadataResult`1 result, ItemUpdateType reason, CancellationToken cancellationToken) at MediaBrowser.Providers.Manager.MetadataService`2.<RefreshMetadata>g__SaveInternal|36_0(BaseItem item, MetadataRefreshOptions refreshOptions, ItemUpdateType updateType, Boolean isFirstRefresh, Boolean requiresRefresh, MetadataResult`1 metadataResult, CancellationToken cancellationToken) at MediaBrowser.Providers.Manager.MetadataService`2.RefreshMetadata(BaseItem item, MetadataRefreshOptions refreshOptions, CancellationToken cancellationToken) at MediaBrowser.Controller.Entities.BaseItem.RefreshMetadata(MetadataRefreshOptions options, CancellationToken cancellationToken) at MediaBrowser.Controller.Entities.Folder.RefreshChildMetadata(BaseItem child, MetadataRefreshOptions refreshOptions, Boolean recursive, IProgress`1 progress, CancellationToken cancellationToken) at MediaBrowser.Controller.LibraryTaskScheduler.LimitedConcurrencyLibraryScheduler.ProcessItem(TaskQueueItem item) ``` ### FFmpeg logs ```shell ``` ### Client / Browser logs _No response_ ### Relevant screenshots or videos _No response_ ### Additional information System is: Supermicro H13SSL-N\ AMD EPYC Genoa 9334 QS (32 x core, 64 x thread)\ 384GB RAM\ ZFS on SSD's for config and cache, ZFS on spinning disks for media. [log_20250630.log](https://github.com/user-attachments/files/20988743/log_20250630.log)
OVERLORD added the bug label 2026-02-07 04:37:07 +03:00
Author
Owner

@felix920506 commented on GitHub (Jul 1, 2025):

What database locking mode do you have set?

@felix920506 commented on GitHub (Jul 1, 2025): What database locking mode do you have set?
Author
Owner

@JPVenson commented on GitHub (Jul 1, 2025):

also please fill out the full system spec section of the bug report.

Did you read the section about adjusting the parallel limit in our release docs? if not, please do so.

@JPVenson commented on GitHub (Jul 1, 2025): also please fill out the full system spec section of the bug report. Did you read the section about adjusting the parallel limit in our release docs? if not, please do so.
Author
Owner

@ptr727 commented on GitHub (Jul 1, 2025):

What database locking mode do you have set?

I don't know, I installed clean and ran, I did not know that I need to change settings before I can use JF?

also please fill out the full system spec section of the bug report.

I'll update with more details.

Did you read the section about adjusting the parallel limit in our release docs? if not, please do so.

No, I did not know that I had to make changes before it would work.

I found the released notes, I see it mentions something about library scan limits, and new DB options, but not the actual options.
Please point me to said options?

P.s. as a vanilla user I do kinda expect the out of the box new install defaults to just work.

@ptr727 commented on GitHub (Jul 1, 2025): > What database locking mode do you have set? I don't know, I installed clean and ran, I did not know that I need to change settings before I can use JF? > also please fill out the full system spec section of the bug report. I'll update with more details. > Did you read the section about adjusting the parallel limit in our release docs? if not, please do so. No, I did not know that I had to make changes before it would work. I found the [released notes](https://notes.jellyfin.org/v10.11.0_features#), I see it mentions something about library scan limits, and new DB options, but not the actual options.\ Please point me to said options? P.s. as a vanilla user I do kinda expect the out of the box new install defaults to just work.
Author
Owner

@JPVenson commented on GitHub (Jul 1, 2025):

i would too. Realitiy is that we still dont know why only for some users this is an issue, only 2/60 of our team members report this issue but we still dont understand why this is happening for those.

For the mayority of users adapting this setting will not be nessesary, but its the correct one to help with that issue.
I am still writing the offical docs for that db lock option and will update the release doc soon.

@JPVenson commented on GitHub (Jul 1, 2025): i would too. Realitiy is that we still dont know why only for some users this is an issue, only 2/60 of our team members report this issue but we still dont understand why this is happening for those. For the mayority of users adapting this setting will not be nessesary, but its the correct one to help with that issue. I am still writing the offical docs for that db lock option and will update the release doc soon.
Author
Owner

@ptr727 commented on GitHub (Jul 1, 2025):

For the mayority of users adapting this setting will not be nessesary, but its the correct one to help with that issue.
I am still writing the offical docs for that db lock option and will update the release doc soon.

Ok, still don't know what "this setting" is, happy to test it out when you want it tested.
In the general/performance section all settings are default / blank.

Btw, I added the system info, note the large number of CPU cores and fast storage, are there any options that default based on CPU core count?

System is:
Supermicro H13SSL-N
AMD EPYC Genoa 9334 QS (32 x core, 64 x thread)
384GB RAM
ZFS on SSD's for config and cache, ZFS on spinning disks for media.
@ptr727 commented on GitHub (Jul 1, 2025): > For the mayority of users adapting this setting will not be nessesary, but its the correct one to help with that issue. > I am still writing the offical docs for that db lock option and will update the release doc soon. Ok, still don't know what "this setting" is, happy to test it out when you want it tested.\ In the general/performance section all settings are default / blank. Btw, I added the system info, note the large number of CPU cores and fast storage, are there any options that default based on CPU core count? ``` System is: Supermicro H13SSL-N AMD EPYC Genoa 9334 QS (32 x core, 64 x thread) 384GB RAM ZFS on SSD's for config and cache, ZFS on spinning disks for media. ```
Author
Owner

@JPVenson commented on GitHub (Jul 1, 2025):

ok very quick detour, i will elaborate in chat if you want.
The "Parallel scan task limit" in <10.11 had a bug that lead to runaway parallism based on core counts. with our new architecture that overwhelmed the sqlite implementation and cause this locking issue. The new one works far better but can still overwhelm the database.

Thats where the locking setting comes into play. I added a new section in our release docs explaining that.

@JPVenson commented on GitHub (Jul 1, 2025): ok very quick detour, i will elaborate in chat if you want. The "Parallel scan task limit" in <10.11 had a bug that lead to runaway parallism based on core counts. with our new architecture that overwhelmed the sqlite implementation and cause this locking issue. The new one works far better but can still overwhelm the database. Thats where the locking setting comes into play. I added a new section in our release docs explaining that.
Author
Owner

@ptr727 commented on GitHub (Jul 1, 2025):

I repeated a fresh setup, same procedure, add one library, default options, but I changed database.xml to <LockingBehavior>Optimistic</LockingBehavior>.

Instead of exceptions for locked DB being logged, I now get lots of:

[2025-07-01 12:38:31.244 -07:00] [WRN] [78] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.244 -07:00] [WRN] [58] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.244 -07:00] [WRN] [73] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.244 -07:00] [WRN] [46] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.244 -07:00] [WRN] [60] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.244 -07:00] [WRN] [85] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.244 -07:00] [WRN] [83] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.244 -07:00] [WRN] [48] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.244 -07:00] [WRN] [59] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.244 -07:00] [WRN] [42] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.244 -07:00] [WRN] [87] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.244 -07:00] [WRN] [61] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.244 -07:00] [WRN] [62] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.244 -07:00] [WRN] [24] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.245 -07:00] [WRN] [45] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.245 -07:00] [WRN] [88] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.245 -07:00] [WRN] [64] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.244 -07:00] [WRN] [77] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.244 -07:00] [WRN] [33] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.244 -07:00] [WRN] [29] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.244 -07:00] [WRN] [51] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.244 -07:00] [WRN] [70] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.244 -07:00] [WRN] [84] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.244 -07:00] [WRN] [75] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:31.245 -07:00] [WRN] [27] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:38:32.442 -07:00] [WRN] [44] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:39:01.313 -07:00] [WRN] [29] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 2
[2025-07-01 12:39:01.313 -07:00] [WRN] [70] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 2
[2025-07-01 12:39:01.313 -07:00] [WRN] [27] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 2
[2025-07-01 12:39:01.313 -07:00] [WRN] [77] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 2
[2025-07-01 12:39:01.313 -07:00] [WRN] [60] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 2
[2025-07-01 12:39:01.313 -07:00] [WRN] [61] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 2
[2025-07-01 12:39:01.313 -07:00] [WRN] [45] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 2
[2025-07-01 12:39:01.763 -07:00] [WRN] [54] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:39:13.469 -07:00] [WRN] [63] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:39:16.023 -07:00] [WRN] [55] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
[2025-07-01 12:39:16.321 -07:00] [WRN] [40] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1
@ptr727 commented on GitHub (Jul 1, 2025): I repeated a fresh setup, same procedure, add one library, default options, but I changed database.xml to `<LockingBehavior>Optimistic</LockingBehavior>`. Instead of exceptions for locked DB being logged, I now get lots of: ```log [2025-07-01 12:38:31.244 -07:00] [WRN] [78] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.244 -07:00] [WRN] [58] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.244 -07:00] [WRN] [73] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.244 -07:00] [WRN] [46] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.244 -07:00] [WRN] [60] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.244 -07:00] [WRN] [85] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.244 -07:00] [WRN] [83] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.244 -07:00] [WRN] [48] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.244 -07:00] [WRN] [59] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.244 -07:00] [WRN] [42] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.244 -07:00] [WRN] [87] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.244 -07:00] [WRN] [61] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.244 -07:00] [WRN] [62] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.244 -07:00] [WRN] [24] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.245 -07:00] [WRN] [45] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.245 -07:00] [WRN] [88] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.245 -07:00] [WRN] [64] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.244 -07:00] [WRN] [77] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.244 -07:00] [WRN] [33] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.244 -07:00] [WRN] [29] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.244 -07:00] [WRN] [51] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.244 -07:00] [WRN] [70] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.244 -07:00] [WRN] [84] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.244 -07:00] [WRN] [75] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:31.245 -07:00] [WRN] [27] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:38:32.442 -07:00] [WRN] [44] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:39:01.313 -07:00] [WRN] [29] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 2 [2025-07-01 12:39:01.313 -07:00] [WRN] [70] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 2 [2025-07-01 12:39:01.313 -07:00] [WRN] [27] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 2 [2025-07-01 12:39:01.313 -07:00] [WRN] [77] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 2 [2025-07-01 12:39:01.313 -07:00] [WRN] [60] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 2 [2025-07-01 12:39:01.313 -07:00] [WRN] [61] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 2 [2025-07-01 12:39:01.313 -07:00] [WRN] [45] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 2 [2025-07-01 12:39:01.763 -07:00] [WRN] [54] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:39:13.469 -07:00] [WRN] [63] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:39:16.023 -07:00] [WRN] [55] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 [2025-07-01 12:39:16.321 -07:00] [WRN] [40] Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior: Operation failed retry 1 ```
Author
Owner

@JPVenson commented on GitHub (Jul 1, 2025):

with your CPU i would also highly recommend setting the parallel scan limit to something reasonable like 6 or 7.

Those log messages are good, they tell you its working

@JPVenson commented on GitHub (Jul 1, 2025): with your CPU i would also highly recommend setting the parallel scan limit to something reasonable like 6 or 7. Those log messages are good, they tell you its working
Author
Owner

@ptr727 commented on GitHub (Jul 1, 2025):

with your CPU i would also highly recommend setting the parallel scan limit to something reasonable like 6 or 7.

What is the default?

@ptr727 commented on GitHub (Jul 1, 2025): > with your CPU i would also highly recommend setting the parallel scan limit to something reasonable like 6 or 7. What is the default?
Author
Owner

@theguymadmax commented on GitHub (Jul 1, 2025):

Dashboard -> General - Parallel library scan tasks limit:
"Maximum number of parallel tasks during library scans. Setting this to 0 will choose a limit based on your systems core count. WARNING: Setting this number too high may cause issues with network file systems; if you encounter problems lower this number."

So in your case you're running 32 parallel scan tasks.

From the release notes:
"For Users that had previously issues with DB lockups, we recommend choosing a value that is below your number of cores available and adjust from there based on your own testing."

@theguymadmax commented on GitHub (Jul 1, 2025): Dashboard -> General - Parallel library scan tasks limit: "Maximum number of parallel tasks during library scans. Setting this to 0 will choose a limit based on your systems core count. WARNING: Setting this number too high may cause issues with network file systems; if you encounter problems lower this number." So in your case you're running 32 parallel scan tasks. From the release notes: "For Users that had previously issues with DB lockups, we recommend choosing a value that is below your number of cores available and adjust from there based on your own testing."
Author
Owner

@ptr727 commented on GitHub (Jul 2, 2025):

So in your case you're running 32 parallel scan tasks.

I see, that seems like maybe not the best choice, maybe default to a more conservative and reliable value like max of cores or 4.
And if Optimistic is the more reliable DB choice, then maybe that could also be the default.
Users could always go and change things, but out of the box defaults in my humble opinion should favor reliability.

@ptr727 commented on GitHub (Jul 2, 2025): > So in your case you're running 32 parallel scan tasks. I see, that seems like maybe not the best choice, maybe default to a more conservative and reliable value like max of cores or 4.\ And if Optimistic is the more reliable DB choice, then maybe that could also be the default.\ Users could always go and change things, but out of the box defaults in my humble opinion should favor reliability.
Author
Owner

@JPVenson commented on GitHub (Jul 2, 2025):

Optimistic can cause replay issues and very low counts will impact the scan performance significantly. Worsining it for everyone is a bad solution too if just 2/60 or so actually need to change it. Worsening everything for 58 out of 60 people is the wrong way.

Those small numbers of installs that experience issues will either read the docs or find help in our chat and will be able to solve this issue then. For the 10.11 release we will expand our jellyfin.org/docs with those informations.

@JPVenson commented on GitHub (Jul 2, 2025): Optimistic can cause replay issues and very low counts will impact the scan performance significantly. Worsining it for everyone is a bad solution too if just 2/60 or so actually need to change it. Worsening everything for 58 out of 60 people is the wrong way. Those small numbers of installs that experience issues will either read the docs or find help in our chat and will be able to solve this issue then. For the 10.11 release we will expand our jellyfin.org/docs with those informations.
Author
Owner

@ptr727 commented on GitHub (Jul 2, 2025):

Other than "parallel library scan tasks limit" and "parallel image encoding limit", under the performance section, are the other places I have to change?

E.g. I see in system.xml LibraryMetadataRefreshConcurrency should I change that, where is it in the UI?

P.s. looked in source, could not find anywhere this is used, just declared in the XML schema?

@ptr727 commented on GitHub (Jul 2, 2025): Other than "parallel library scan tasks limit" and "parallel image encoding limit", under the performance section, are the other places I have to change? E.g. I see in system.xml `LibraryMetadataRefreshConcurrency` should I change that, where is it in the UI? P.s. looked in source, could not find anywhere this is used, just declared in the XML schema?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#7133