-
Notifications
You must be signed in to change notification settings - Fork 44
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
wakeup-cleanup: only allow one wakeup calblack per I/O operation #161
Conversation
bookkeeping to be wrong for async responses Introduced in inhabitedtype/httpaf#161
…eping to be wrong for async responses (#37) Introduced in inhabitedtype/httpaf#161
[inhabitedtype/httpaf#161](inhabitedtype/httpaf#161) that caused `wake_up_writer` callback bookkeeping to be slightly wrong due to physical equality, producing runtime errors in cases where it shouldn't ([#37](anmonteiro/httpun#37)).
@seliopou @dpatti This PR seems to introduce a regression, starting from it's merge point and up to latest master (d22250e as of now) tests of our in-house framework build on top of httpaf hang. I've looked at test that hangs, it does not seem to do anything complicated, creates http server with handler, serving json payload, and a client which requests it (both built on httpaf). |
Could you send a PR with a rest case that exhibits the bug? Given the test framework it should be possible to exactly replicate the inputs and outputs by looking at an strace of the client and/or server, but let me know if you need any help with that.
…-Spiros E.
i sent this from my Phone.
On Apr 2, 2020, at 3:43 PM, Konstantin A. Olkhovskiy ***@***.***> wrote:
@seliopou @dpatti This PR seems to introduce a regression, starting from it's merge point and up to latest master (d22250e as of now) tests of our in-house framework build on top of httpaf hang. I've looked at test that hangs, it does not seem to do anything complicated, creates http server with handler, serving json payload, and a client which requests it (both built on httpaf).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Doug and I took a look at this and think we know the cause of it. |
Some context on what was going on here for the record: one subtle change introduced in this PR is that we always transfer the writer callback to
That third step caused an exception because there was already a callback registered. I'm curious @Lupus if your httpaf runtime was actually raising an exception inside the write loop but it was somehow being swallowed, so it appeared as though the request was just hanging. I also believe that if the write loop is started before the read loop, this would not happen because in step two we'd be transferring a real callback and wouldn't have an issue of callbacks colliding. I think this is why we never noticed this in practice. The fix of introducing the optional thunk was both a nice refactor to pull a common pattern out of three modules, and it made it more clear that we shouldn't pass a |
Thanks for the details @dpatti ! We've been tweaking exceptions in our Lwt adapter fork, I don't recall the details but we recently tried pinning httpaf to latest master in one of our services (but before this regression was fixed) and got this error:
Looks like it might be related. |
…eping to be wrong for async responses (#37) Introduced in inhabitedtype/httpaf#161
…eping to be wrong for async responses (#37) Introduced in inhabitedtype/httpaf#161
Cleanup wakeup callback bookkeeping that got a bit hairy as a result of #158.
Body
only allows a single wakeup callback to be registered with it, so just propagate that constraint up to the server connection layer.