Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Address PR comments
  • Loading branch information
agocke committed Sep 29, 2021
commit acc887934384eb4ad68d93b2e2c8d78a1d29fcd5
4 changes: 2 additions & 2 deletions src/installer/tests/TestUtils/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,14 @@ public Command Start()

// Retry if we hit ETXTBSY due to Linux race
// https://github.com/dotnet/runtime/issues/58964
for (int i = 0; i < 3; i++)
for (int i = 0; ; i++)
{
try
{
Process.Start();
break;
}
catch (Win32Exception e) when (e.Message.Contains("Text file busy"))
catch (Win32Exception e) when (i < 3 && e.Message.Contains("Text file busy"))
{
// 10 ms is short, but the race we're trying to avoid is in-between
// "fork" and "exec", so it should be fast
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to balance latency and likelihood of waiting long enough, perhaps we should scale the backoff a little, like this could be Sleep(i * 10) ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably worth seeing if this solves the issue, but there's no reason we can't come back to it later.

Expand Down