Allowing ConnectionManager and ConnectionPool to be disposed of both synchronously and asynchronously #460
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[sc-53245]
Background
When we tried using the latest Halibut in Octopus Server, tests would time out.
Results
Related to OctopusDeploy/Issues#8266
Before
Octopus Server would dispose of the Halibut runtime via Autofac, which would sense that the
IHalibutRuntime
implementedIAsyncDisposable
.But this completely ignores whether the feature toggle is turned on.
As a result, it would try to dispose a 'synchronous' Halibut 'asynchronously'.
This would cause the
ConnectionManager
to be disposed of asynchronously, which throws an exception if that occurs.After
We have now made both
ConnectionManager
andConnectionPool
be disposable asynchronously.This solves the issue, but also, it is probably a good idea to allow both paths of disposal to be allowed.
While here, we also noticed that
CreateNewConnection
is never called (so it was deleted).We also had to reinstate
OSSupportsWebSockets
, as this is used in Octopus Server.How to review this PR
Quality ✔️
Pre-requisites