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

Attempt to work around Unix.socketpair issue on Win32 #269

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

polytypic
Copy link
Collaborator

@polytypic polytypic commented Sep 9, 2024

Unix.socketpair occasionally fails on Windows:

--- a/_build/default/lib/picos_io/picos_io.mli
+++ b/_build/default/lib/picos_io/.mdx/picos_io.mli.corrected
@@ -753,7 +753,5 @@ end
           send_string "Hello, world!";
           send_string "POSIX with OCaml";
         end
-      Hello, world!
-      POSIX with OCaml
-      - : unit = ()
+      Exception: Unix.Unix_error(Unix.EADDRINUSE, "socketpair", "")
     ]} *)

This introduces a workaround to retry Unix.socketpair a few times to avoid random CI failures #259.

@polytypic polytypic force-pushed the win32-socketpair-workaround branch from 78972fb to 50f984a Compare September 9, 2024 07:38
`Unix.socketpair` occasionally fails on Windows:

```diff
--- a/_build/default/lib/picos_io/picos_io.mli
+++ b/_build/default/lib/picos_io/.mdx/picos_io.mli.corrected
@@ -753,7 +753,5 @@ end
           send_string "Hello, world!";
           send_string "POSIX with OCaml";
         end
-      Hello, world!
-      POSIX with OCaml
-      - : unit = ()
+      Exception: Unix.Unix_error(Unix.EADDRINUSE, "socketpair", "")
     ]} *)
```

This introduces a work around to retry `Unix.sockepair` a few times on Win32
when the `EADDRINUSE` error is raised.  We shuld remove the workaround once the
root issue is fixed.
@polytypic polytypic force-pushed the win32-socketpair-workaround branch from 50f984a to 0732807 Compare September 9, 2024 07:51
@polytypic polytypic marked this pull request as ready for review September 9, 2024 07:57
@polytypic polytypic merged commit 376152c into main Sep 9, 2024
7 checks passed
@polytypic polytypic deleted the win32-socketpair-workaround branch September 9, 2024 09:37
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.

1 participant