Skip to content

Commit

Permalink
Issue jstarks#7: Add retries on busy pipe instances
Browse files Browse the repository at this point in the history
  • Loading branch information
axxelG committed Nov 17, 2020
1 parent 4997d3b commit 8e19a09
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions npiperelay.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ func dialPipe(p string, poll bool) (*overlappedFile, error) {
time.Sleep(200 * time.Millisecond)
continue
}
if err.Error() == "All pipe instances are busy." {
if *verbose {
log.Printf("All pipe instances are busy. Waiting 200 milliseconds to retry")
}
time.Sleep(200 * time.Millisecond)
continue
}
return nil, &os.PathError{Path: p, Op: "open", Err: err}
}
}
Expand Down

0 comments on commit 8e19a09

Please sign in to comment.