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

IOStream read can fail if closed with an open read buffer #2717

Closed
minrk opened this issue Aug 1, 2019 · 1 comment · Fixed by #2805
Closed

IOStream read can fail if closed with an open read buffer #2717

minrk opened this issue Aug 1, 2019 · 1 comment · Fixed by #2805

Comments

@minrk
Copy link
Contributor

minrk commented Aug 1, 2019

I'm currently investigating the issue mentioned here and I've narrowed the situation down somewhat:

SimpleAsyncHTTPRequest is making a POST request with an empty body to a server that is responding very quickly. In this case, it is the request to github.com to complete GitHub OAuth.

When read_until_regex is called in

  • read buffer is not empty, but
  • stream is closed

So a closed check is apparently occurring before the read is attempted from the existing buffer. Interestingly, #2670 introduces exactly such a premature closed check (a _try_inline_read() would succeed if attempted), but the issue still occurs in 6.0.2, prior to #2670, so there must be an additional check that's causing StreamClosedError to be raised even when the

I'm trying to provoke this with a self-contained test case that doesn't require github credentials, but haven't managed it yet. Will report back when I do.

Using curl_httpclient does not appear to exhibit this behavior.

I think this is related to #2651 in that it's another issue in 6.0 where there are races between the closed state and pending reads/writes.

@bdarnell
Copy link
Member

bdarnell commented Aug 2, 2019

This is the same as #2695, right?

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