Skip to content

Commit

Permalink
Prevent this from trying to create named pipes indefinitely
Browse files Browse the repository at this point in the history
  • Loading branch information
caesay committed Oct 9, 2022
1 parent b460d49 commit 8a3e8e3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Clowd/Util/MutexArgsForwarder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,18 @@ async Task AcceptConnection()
server.WaitForRemotePipeCloseAsync().ContinueWith(v => server.Dispose());
}

int err = 0;
while (!token.IsCancellationRequested)
{
try
{
await AcceptConnection();
err = 0;
}
catch (Exception ex)
{
_log.Error(ex, "Unable to receive named pipe connection request");
if (err++ > 3) return; // exit if 3 errors in a row.
}
}
}
Expand Down

0 comments on commit 8a3e8e3

Please sign in to comment.