Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DistributedLockingWriteLockDefaultTimeout can not be higher than 20 seconds #18143

Closed
nikolaj-kaplan opened this issue Jan 28, 2025 · 4 comments

Comments

@nikolaj-kaplan
Copy link

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

15.0.0

Bug summary

We are getting timeouts at high loads in our Umbraco solution.
I adjusted the DistributedLockingWriteLockDefaultTimeout to 20 seconds and saw significant improvements.
I would like to set it even higher, but for some reason this is not possible.
I would much rather wait 30 or 60 seconds and get a success than I want to get errors in the log and in the backoffice UI.

Is there any good arguments for not allowing higher timeout than 20 seconds?

This is the code that would need to be adjusted to allow a timeout higher than 20 sec.

Image

Specifics

No response

Steps to reproduce

Set the timeout in appsettings.json to 30 seconds

  "Umbraco": {
    "CMS": {
      "Global": {
        "DistributedLockingWriteLockDefaultTimeout": "00:00:30"

Expected result / actual result

Desired result: no error when Umbraco starts up.
Actual result: appsettings validation fails at Umbraco startup.

Microsoft.Extensions.Options.OptionsValidationException
  HResult=0x80131500
  Message=The `Umbraco:CMS:Global:DistributedLockingWriteLockDefaultTimeout` setting is not between the minimum of 100 ms and maximum of 20000 ms
  Source=Microsoft.Extensions.Options
  StackTrace:
   at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name)
   at Microsoft.Extensions.Options.UnnamedOptionsManager`1.get_Value()
   at Umbraco.Cms.Infrastructure.DependencyInjection.UmbracoBuilderExtensions.<>c.<AddMainDom>b__3_0(IServiceProvider factory)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Umbraco.Extensions.WebApplicationExtensions.<BootUmbracoAsync>d__0.MoveNext()
   at Program.<<Main>$>d__0.MoveNext() in C:\p\DR\drdk-artikel-cms\src\Drdk.Article.Cms\Program.cs:line 54
Copy link

Hi there @nikolaj-kaplan!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

  • We'll assess whether this issue relates to something that has already been fixed in a later version of the release that it has been raised for.
  • If it's a bug, is it related to a release that we are actively supporting or is it related to a release that's in the end-of-life or security-only phase?
  • We'll replicate the issue to ensure that the problem is as described.
  • We'll decide whether the behavior is an issue or if the behavior is intended.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@kjac
Copy link
Contributor

kjac commented Jan 29, 2025

Hi @nikolaj-kaplan

Thanks for reaching out, and not least for the excellent investigation work 👏

I don't see why we shouldn't allow for larger timeout values. We have a 60 second default for read lock timeouts (DistributedLockingReadLockDefaultTimeout), with no upper (or lower) limit.

I'll take this one to the team and get back with an answer 👍

@kjac kjac self-assigned this Jan 29, 2025
@kjac
Copy link
Contributor

kjac commented Feb 5, 2025

Quick follow-up here. We'll remove the hard upper limit entirely so it can be configured freely. PR incoming for V15.3 soon 👍

@AndyButland
Copy link
Contributor

The limit has been removed via #18260 and will be released in 15.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants