Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.

ignore expected errors on Windows #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vinipsmaker
Copy link

On Windows, the recv_from operation on the UDP socket may return the
following errors, which are expected and should be ignored:

  • 10054 (WSAECONNRESET): Windows can send this error if a previous send
    operation resulted in an ICMP Port Unreachable. And if it's a loopback
    interface, it can know whether there is already another end to
    communicate.
  • 10040 (WSAEMSGSIZE): This error was randomly appearing in a test that
    I conducted. Not really sure why it's happening. The frequency
    decreased when I increased the receive buffer size, but it was not
    important to get a network up and running.

Without these changes, it was impossible to get a relatively large
network running without issues. By large I mean a test that might be too
bursting for a single machine to run.

More references:

On Windows, the recv_from operation on the UDP socket may return the
following errors, which are expected and should be ignored:

- 10054 (WSAECONNRESET): Windows can send this error if a previous send
  operation resulted in an ICMP Port Unreachable. And if it's a loopback
  interface, it can know whether there is already another end to
  communicate.
- 10040 (WSAEMSGSIZE): This error was randomly appearing in a test that
  I conducted. Not really sure why it's happening. The frequency
  decreased when I increased the receive buffer size, but it was not
  important to get a network up and running.

Without these changes, it was impossible to get a relatively large
network running without issues. By large I mean a test that might be too
bursting for a single machine to run.

More references:

- http://stackoverflow.com/questions/30749423/is-winsock-error-10054-wsaeconnreset-normal-with-udp-to-from-localhost#comment49588739_30749423
- maidsafe-archive/crust#454
@vinipsmaker
Copy link
Author

Original commit (which was applied on top of a branch with the set-read-timeout patchset and therefore is a little different): vinipsmaker@64fddb4

@vinipsmaker
Copy link
Author

The failure on CI is thanks to a problem with Rust nightly. If you change the CI to use Rust stable we may get better results. I've seen this error before elsewhere.

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

Successfully merging this pull request may close these issues.

1 participant