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

Criterion hangs the process because for some reason the server socket can’t detect that client has closed connection #726

Open
softstream-link opened this issue Sep 22, 2023 · 0 comments

Comments

@softstream-link
Copy link

This only happens on Linux but works fine on Darwin and when criterion is used to do clt.read , however when a standard for loop is used all works fine

  • Example contains a main function which in-turn calls two for the most part identical functions
let _ = clt2svc_without_criterion();
let _ = clt2svc_with_criterion();
  • Both functions have the same objective

  • create and connect two non-blocking TcpStream’s to each other

    • clt TcpStream, will connect from main thread
    • svc TcpStream, will be accepted from Svc-Thread thread
  • svc TcpSteam will continually write to the socket untill it gets an io::std::Error

  • clt TcpStream will continually read N number of times and then issue clt.shutdown(Shutdown::Both)

  • The only difference between two functions is one uses criterion to measure the read speed and the other a standard for loop. However the one that uses criterion variant hangs as the svc TcpStrem gets ErrorKind::WouldBlock instead of ErrorKind::BrokenPipe

Full Example

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

No branches or pull requests

1 participant