Skip to content

Pruning timer not disposed even after disposing all SqlConnection instances #1881

Description

@a510

Bug Description

I'm not sure if this is a bug or by-design but the trace log keeps showing this message once I use SqlConnection and even after disposing it.

20:02:52.463|[AdvancedTrace]|<prov.DbConnectionFactory.PruneConnectionPoolGroups|RES|INFO|CPOOL> 1
20:03:22.468|[AdvancedTrace]|<prov.DbConnectionFactory.PruneConnectionPoolGroups|RES|INFO|CPOOL> 1
20:03:52.464|[AdvancedTrace]|<prov.DbConnectionFactory.PruneConnectionPoolGroups|RES|INFO|CPOOL> 1
20:04:22.476|[AdvancedTrace]|<prov.DbConnectionFactory.PruneConnectionPoolGroups|RES|INFO|CPOOL> 1
20:04:52.472|[AdvancedTrace]|<prov.DbConnectionFactory.PruneConnectionPoolGroups|RES|INFO|CPOOL> 1
...

To reproduce

Run this code with trace logging enabled.

var connection = new SqlConnection(conStr);
connection.Open();
connection.Dispose();

Console.ReadLine();

Expected behavior

The prune stops when there's no more pools and the timer is disposed.

Further technical details

Microsoft.Data.SqlClient version: 5.0.1
.NET target: (dotnet 7.0)

Activity

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

Metadata

Metadata

Labels

Area\Connection PoolingUse this label to tag issues that apply to problems with connection pool.

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions