-
Notifications
You must be signed in to change notification settings - Fork 340
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
"Unmasked client to server frame" causes 502s #566
Comments
@alexandergunnarson Hi Alex, A few questions so long-
Thanks |
Hey! Thanks for your quick response.
|
If CloudFront logs are to be believed, the following headers were forwarded for the most recent offending WS requests (all such requests yield 401 or 502 errors):
The load balancer we have is "dumb" in that it forwards everything and is unlikely to affect anything. |
Just checked and the vast majority of our WebSocket requests (both failed and successful) are HTTP/1.1, so we can seemingly rule out the headers issue. |
@alexandergunnarson Hi Alex, apologies for the delay replying! Unfortunately this isn't an area I'm familiar with so it's not clear to me what might be going on here. From some very light digging, what I gather is:
I'm just engaged with some other work atm so won't have the opportunity to investigate further right now, but perhaps you or someone else might be able to? Some quick ideas- Re: possible cause 1
Re: possible cause 2
Re: possible cause 3
Re: possible cause 4
Next stepsI've marked this issue as Otherwise I'll try take a closer look myself when I'm next on batched http-kit work. In the meantime any additional info you could provide (esp. re: questions above) would be helpful! |
Thanks so much for your help @ptaoussanis! Unfortunately after some deliberation we decided to move to Jetty 11 and put together a working Sente adapter for it. Took a bit of tweaking but works great now! |
Cross-posting taoensso/sente#426 (comment) |
@alexandergunnarson You're very welcome, I'm sorry that you needed to put effort into a move! But happy it worked out (and happy for Sente to get Jetty 11 support!). Thanks for updating 👍 Will keep this issue open until someone can investigate further and hopefully find a fix on http-kit's side if necessary/possible. |
No worries — appreciate your support :) |
Hey @ptaoussanis — huge fan of http-kit. We use http-kit (both server and client) at my company, with Sente on top.
Wanted to figure out together why a particularly nasty issue is happening. Every time I see the following stack trace show up in our logs:
we get 502s in various subsequent requests to that server, even unrelated to WebSockets. The problem appears to linger for a few minutes, but it could be less. I believe there are still some successful requests that go through in that time frame — not every request to the affected server will 502 during that time, as far as I can tell, but I can double check this. (I haven't yet traced which requests 502 and which don't, and why.)
We run on AWS, and have our servers load balanced behind CloudFront. The 502 is being emitted from the AWS load balancer due to its failure to connect to a server that experienced the
unmasked client to server frame
issue.Given that you have much more familiarity with http-kit's code than I, are you aware of some mechanism that might cause it to 502? It's almost as if it's defensively dropping requests for a time, or an event loop dies (I do see
server-loop
in the logs, after all) and needs a little time to pick itself back up.Meanwhile I'll go dig into http-kit's code to see if I can gather any clues.
Also curious what you might recommend to mitigate this problem. Maybe a relevant exception needs to be caught somewhere? Presumably can't do much to mitigate the issue on the client end, as bad payloads happen sometimes.
Thanks! 🙏
The text was updated successfully, but these errors were encountered: