Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix broken pipe issue #1958

Merged
merged 1 commit into from
Mar 21, 2022
Merged

fix broken pipe issue #1958

merged 1 commit into from
Mar 21, 2022

Conversation

adamsitnik
Copy link
Member

@adamsitnik adamsitnik commented Mar 21, 2022

This PR fixes a bug that I've introduced in #1940

In #1940 I've changed the benchmark process code to not wait for a blocking acknowledgment if there is no need to.

But he thost process was still writing the acknowledgments (which were just ignored by the benchmark process). In cases when benchmark process has managed to already quit, it's std in was closed and host was failing with "broken pipe":

at System.IO.FileStream.WriteNative(ReadOnlySpan`1 source)
   at System.IO.FileStream.FlushWriteBuffer()
   at System.IO.FileStream.Flush(Boolean flushToDisk)
   at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
   at System.IO.StreamWriter.WriteLine(String value)
   at BenchmarkDotNet.Loggers.SynchronousProcessOutputLoggerWithDiagnoser.ProcessInput() in /Users/runner/work/1/s/src/BenchmarkDotNet/Loggers/SynchronousProcessOutputLoggerWithDiagnoser.cs:line 57
   at BenchmarkDotNet.Toolchains.Executor.Execute(Process process, BenchmarkCase benchmarkCase, SynchronousProcessOutputLoggerWithDiagnoser loggerWithDiagnoser, ILogger logger, ConsoleExitHandler consoleExitHandler, Int32 launchIndex) in /Users/runner/work/1/s/src/BenchmarkDotNet/Toolchains/Executor.cs:line 72
   at BenchmarkDotNet.Toolchains.Executor.Execute(BenchmarkCase benchmarkCase, BenchmarkId benchmarkId, ILogger logger, ArtifactsPaths artifactsPaths, String args, IDiagnoser diagnoser, IResolver resolver, Int32 launchIndex) in /Users/runner/work/1/s/src/BenchmarkDotNet/Toolchains/Executor.cs:line 50
   at BenchmarkDotNet.Toolchains.Executor.Execute(ExecuteParameters executeParameters) in /Users/runner/work/1/s/src/BenchmarkDotNet/Toolchains/Executor.cs:line 34
   at BenchmarkDotNet.Running.BenchmarkRunnerClean.RunExecute(ILogger logger, BenchmarkCase benchmarkCase, BenchmarkId benchmarkId, IToolchain toolchain, BuildResult buildResult, IResolver resolver, IDiagnoser diagnoser, Int32 launchIndex) in /Users/runner/work/1/s/src/BenchmarkDotNet/Running/BenchmarkRunnerClean.cs:line 514
   at BenchmarkDotNet.Running.BenchmarkRunnerClean.Execute(ILogger logger, BenchmarkCase benchmarkCase, BenchmarkId benchmarkId, IToolchain toolchain, BuildResult buildResult, IResolver resolver) in /Users/runner/work/1/s/src/BenchmarkDotNet/Running/BenchmarkRunnerClean.cs:line 414
   at BenchmarkDotNet.Running.BenchmarkRunnerClean.RunCore(BenchmarkCase benchmarkCase, BenchmarkId benchmarkId, ILogger logger, IResolver resolver, BuildResult buildResult) in /Users/runner/work/1/s/src/BenchmarkDotNet/Running/BenchmarkRunnerClean.cs:line 385
   at BenchmarkDotNet.Running.BenchmarkRunnerClean.Run(BenchmarkRunInfo benchmarkRunInfo, Dictionary`2 buildResults, IResolver resolver, ILogger logger, List`1 artifactsToCleanup, String resultsFolderPath, String logFilePath, Int32 totalBenchmarkCount, StartedClock& runsChronometer, Int32& benchmarksToRunCount) in /Users/runner/work/1/s/src/BenchmarkDotNet/Running/BenchmarkRunnerClean.cs:line 164
   at BenchmarkDotNet.Running.BenchmarkRunnerClean.Run(BenchmarkRunInfo[] benchmarkRunInfos) in /Users/runner/work/1/s/src/BenchmarkDotNet/Running/BenchmarkRunnerClean.cs:line 79
   at BenchmarkDotNet.Running.BenchmarkRunner.RunWithDirtyAssemblyResolveHelper(Type type, IConfig config, String[] args) in /Users/runner/work/1/s/src/BenchmarkDotNet/Running/BenchmarkRunnerDirty.cs:line 84
   at BenchmarkDotNet.Running.BenchmarkRunner.RunWithExceptionHandling(Func`1 run) in /Users/runner/work/1/s/src/BenchmarkDotNet/Running/BenchmarkRunnerDirty.cs:line 132
   at BenchmarkDotNet.Running.BenchmarkRunner.Run(Type type, IConfig config, String[] args) in /Users/runner/work/1/s/src/BenchmarkDotNet/Running/BenchmarkRunnerDirty.cs:line 31
   at BenchmarkDotNet.IntegrationTests.BenchmarkTestExecutor.CanExecute(Type type, IConfig config, Boolean fullValidation) in /Users/runner/work/1/s/tests/BenchmarkDotNet.IntegrationTests/BenchmarkTestExecutor.cs:line 53
   at BenchmarkDotNet.IntegrationTests.CoreRtTests.LatestCoreRtVersionIsSupported() in /Users/runner/work/1/s/tests/BenchmarkDotNet.IntegrationTests/CoreRtTests.cs:line 26

The fix is stop redirect standard input and writing acks when nobody needs them.

fixes #1957

cc @radical @DrewScoggins who has most likely hit it in the last few days

@adamsitnik adamsitnik added this to the v0.13.2 milestone Mar 21, 2022
@adamsitnik
Copy link
Member Author

the failures are unrelated, I am merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken pipe
1 participant