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

The app hangs when interrupted on reading from client_socket #50

Open
rexim opened this issue Nov 22, 2017 · 1 comment
Open

The app hangs when interrupted on reading from client_socket #50

rexim opened this issue Nov 22, 2017 · 1 comment
Labels

Comments

@rexim
Copy link
Member

rexim commented Nov 22, 2017

Somewhere here

;;; request_buffer_size = read(client_socket, request_buffer, REQUEST_BUFFER_CAPACITY)

Reproduction

  1. Request a resource
  2. ^C the app
  3. Repeat 1 and 2 several time to catch the moment. When app doesn't exit on ^C the bug is reproduced
  4. Attach to the process with strace and ensure that the process is stuck on the read call.

Observed

App doesn't exist on ^C

Expected

App exists on ^C clearly

Notes

If during the blocked state on the read call you request the page again, the app exists.

@rexim rexim added the bug label Nov 22, 2017
@rexim
Copy link
Member Author

rexim commented Nov 22, 2017

Comment from the stream

ProvodGL: Also, what read() will do on SIGINT (or SIGanything) is a bit complicated and depends on SA_RESTART flag. Generally, if the flag is not set, it will fail with EINTR. Otherwise it will be automatically restarted. But I believe there are some edge cases when you can't actually rely on that. Don't remember the details, though.

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

No branches or pull requests

1 participant