Skip to content

[HTTP/3] HttpConnectionPool may leak authorityExpireTimer / hit ObjectDisposedException #66782

@MihaZupan

Description

@MihaZupan

Based on code inspection.

HttpConnectionPool.HandleAltSvc may create a Timer if Dispose runs during/before it, and it will never be disposed.
The method should check _disposed in this branch (while holding the lock), before creating a new Timer:

The good news is that the timer won't root the HttpConnectionPool instance, but the timer entry may remain queued for a month.

A related issue is that the same method will also access the _authorityExpireTimer outside a lock a few lines above, which could lead to an unexpected ObjectDisposedException leaking out:

_authorityExpireTimer.Change(Timeout.Infinite, Timeout.Infinite);

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions