-
Notifications
You must be signed in to change notification settings - Fork 8
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
UV_EAGAIN (errno 4088) related to high/low watermarks. #13
Comments
This seems to be an issue beyond my scope of knowledge but I have seen it do things and bugs at times. Even I'm still trying to port more stuff from linux over to windows. I will flag this issue as a bug for now but if I knew which cython file this was coming from that will help me figure out how to fix it... |
To reproduce this error easily I'm attaching a small program hi2.py. If you run You can also disable the use of Winloop to see that the error does not happen with the default event loop. Or try some other settings, for which the problem sometimes disappears, or shows a different kind of error. |
For now, using hard coded error numbers.
Looks like I've found a fix for the problem behind this issue #13, and also a fix for the other issue #12. I had been looking at the reason why the errors are actually not printed correctly on Windows, and that way I was prepared to see the problems in these two lines of Winloop/handles/stream.pyx at some point: Winloop/winloop/handles/stream.pyx Line 573 in 8f38d32
Winloop/winloop/handles/stream.pyx Line 789 in 8f38d32
On Windows, we have |
@lschoe I will try to implement this in shortly thanks for figuring this out for me... |
@lschoe I merged your pull request instead. I was confused with what was needed but I will close this issue now that it's correctly been handled... |
Great! This way I can now run all MPyC programs, with all datasets small to large, experiencing the same kind of speedup for Winloop as for uvloop. The PR is a simple, direct fix. For a more systematic fix, also to cover other potential problems due to misaligned error numbers, I think a nice target for you is to first fix the error messages printed by Winloop, Currently, we get something like "OSError: [Errno 4088] Unknown error" printed, but -- from looking at your typedef enum {
#define XX(code, _) UV_ ## code = UV__ ## code,
UV_ERRNO_MAP(XX)
#undef XX
UV_ERRNO_MAX = UV__EOF - 1
} uv_errno_t; which takes things (prefixed with Ideally, you can fix this such that you can use the existing uvloop code involving error codes without making changes at that level. Only some changes at a lower level, to deal with the mapping of the error numbers, is done in one central place in the source code for Winloop. |
This issue is about the second problem mentioned in issue #12.
The problem seems to be related to the current flow control implementation in Winloop 0.1.0. An UV_EAGAIN (errno 4088) occurs when handling larger volumes of data exchanges. The problem is not present with any of the other event loops (asyncio's proactor, selector, nor with uvloop).
You can reproduce the problem running, e.g., the np_lpsolver demo for the MPyC package. The following code is from the latest version MPyC v0.9.7 on GitHub, see mpyc/asyncoro.py. This is inside the
connection_made(transport)
method:Using
python np_lpsolver.py -i5 -M3 -E1
inmpyc/demos
runs the demo between three parties on localhost using Winloop. If the default flow control settings are used, all parties will get a 4088 error. If the high watermark is increased from2**16
to2**18
, the problem disappears. The problem also disappears by settinghigh=0
. But, interestingly, these workarounds do not work with SSL.The text was updated successfully, but these errors were encountered: