autofac / Autofac

An addictive .NET IoC container
https://autofac.org
MIT License
4.44k stars 836 forks source link

reduce lock contention in LifetimeScope.CreateSharedInstance #1375

Closed botinko closed 1 year ago

botinko commented 1 year ago

image

Found lock contention while load testing of our application. Avoid locking on happy path.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 37.50% and project coverage change: -0.07 :warning:

Comparison is base (1910177) 78.53% compared to head (d4b7220) 78.47%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #1375 +/- ## =========================================== - Coverage 78.53% 78.47% -0.07% =========================================== Files 199 199 Lines 5717 5719 +2 Branches 1162 1164 +2 =========================================== - Hits 4490 4488 -2 - Misses 715 717 +2 - Partials 512 514 +2 ``` | [Impacted Files](https://codecov.io/gh/autofac/Autofac/pull/1375?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autofac) | Coverage Δ | | |---|---|---| | [src/Autofac/Core/Lifetime/LifetimeScope.cs](https://codecov.io/gh/autofac/Autofac/pull/1375?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autofac#diff-c3JjL0F1dG9mYWMvQ29yZS9MaWZldGltZS9MaWZldGltZVNjb3BlLmNz) | `82.73% <37.50%> (-2.21%)` | :arrow_down: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autofac). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autofac)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

botinko commented 1 year ago

@tillig Sure! When can we expect a new release? Can I at least make a developer build for MyGet? There are no new build since 7.0.0 release. In our load tests, the problem is reproducible. Or I can create the package by myself and put it in private repo.

tillig commented 1 year ago

All develop builds are already in MyGet, but they'll show as earlier than 7.0 because we haven't incremented the version. Look at the date instead. I've been a bit busy trying to get compatibility releases out for Autofac 7 integration packages, sorry.

botinko commented 1 year ago

Thanks! 7.0.0-develop-01517 build works for me.

tillig commented 1 year ago

I'm working hard on getting a 7.0.1 out and it should be out soon but MyGet is having some problems right now where I push a package but it isn't showing up in the feed. I'm working with MyGet now on that. Eventually (and soon) you should see a 7.0.1 on NuGet proper.