Skip to content

[Bug]: RuntimeConfigProvider._changeTokenRegistration is never disposed due to missing IDisposable interface and pre-created instance registration #3403

@aaronburtle

Description

@aaronburtle

What happened?

RuntimeConfigProvider has a Dispose() method that cleans up its _changeTokenRegistration (a change token subscription), but this method is never called for two reasons:

Missing interface: RuntimeConfigProvider does not implement IDisposable, it only has a public Dispose() method. The DI container only auto-disposes services that implement IDisposable or IAsyncDisposable.

Pre-created instance registration: In Startup.cs, the provider is created before being registered with the container.

Even if IDisposable were added, the .NET DI container does not dispose pre-created instances; it only disposes instances it created itself (via type or factory registrations).

Need to implement IDisposable and switch to a factory registration or other means of getting the container to manage the lifecycle.

Version

2.0

What database are you using?

Azure SQL

What hosting model are you using?

No response

Which API approach are you accessing DAB through?

No response

Relevant log output


Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

2.1bugSomething isn't working

Type

Projects

Status

Review In Progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions