OctopusDeploy / Halibut

| Public | A secure communication stack for .NET using JSON-RPC over SSL.
Other
12 stars 44 forks source link

Optimise the usage of CancellationTokens #481

Closed nathanwoctopusdeploy closed 1 year ago

nathanwoctopusdeploy commented 1 year ago

Background

This PR has a few changes around the way cancellation tokens are used to reduce some undesirable memory growth and object retention observed in Async Halibut when running at scale.

The combination of these fixes seems to have reduced the observed memory growth, with the GC seen to be working more efficiently and has removed some suspect retention of object around Sockets.

Please see the comments for details of the individual changes.

Related to https://github.com/OctopusDeploy/Issues/issues/8266

How to review this PR

Quality :heavy_check_mark:

Pre-requisites