File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/BenchmarkDotNet/Loggers Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,15 @@ internal void ProcessData()
55
55
56
56
writer . WriteLine ( Engine . Signals . Acknowledgment ) ;
57
57
58
- if ( signal == HostSignal . AfterAll )
58
+ if ( signal == HostSignal . BeforeAnythingElse )
59
+ {
60
+ // The client has connected, we no longer need to keep the local copy of client handle alive.
61
+ // This allows server to detect that child process is done and hence avoid resource leak.
62
+ // Full explanation: https://stackoverflow.com/a/39700027
63
+ inputFromBenchmark . DisposeLocalCopyOfClientHandle ( ) ;
64
+ acknowledgments . DisposeLocalCopyOfClientHandle ( ) ;
65
+ }
66
+ else if ( signal == HostSignal . AfterAll )
59
67
{
60
68
// we have received the last signal so we can stop reading from the pipe
61
69
// if the process won't exit after this, its hung and needs to be killed
You can’t perform that action at this time.
0 commit comments