Skip to content

Conversation

srogovtsev
Copy link

As shown in #15, the fact that we don't dispose AutofacWebApiDependencyScope can lead to undesired resource consumption by AutofacWebApiDependencyScope hanging in the finalizer queue. This PR aims to fix this by suppressing finalization for AutofacWebApiDependencyScope, as we know that its resources (ILifetimeScope) will be properly disposed in the caller.

@srogovtsev
Copy link
Author

This will probably be redundant if autofac/Autofac.WebApi#69, which completely removes the finalizer from AutofacWebApiDependencyScope, is merged.

@srogovtsev srogovtsev force-pushed the gc-suppress-finalize-for-dependency-scope branch from 80c5971 to 40f6263 Compare July 16, 2022 13:54
@srogovtsev srogovtsev changed the title Avoid AutofacWebApiDependencyScope in finalizer queue Suppress finalization for AutofacWebApiDependencyScope Jul 16, 2022
@tillig
Copy link
Member

tillig commented Aug 2, 2022

I merged in autofac/Autofac.WebApi#69 and that will be released as soon as my PR for the build/housekeeping autofac/Autofac.WebApi#70 gets merged in. I'll update the minimum Autofac.WebApi2 package dependency here once that's released so, as noted above, this PR should become redundant.

Given that, I'll close this one and move forward with the stated plan. If it turns out that's not enough, we can always revisit this.

@tillig tillig closed this Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants