-
Notifications
You must be signed in to change notification settings - Fork 50
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
Allow IoBuffer to hold multiple packets #531
Conversation
I notice the |
@OxleyS yeah that's what I think too. Would it be possible for you to test with this branch and that log message I just added? I want to see if this happens. |
Sure, I can't promise too much since the panic has so far been extremely rare, but I can certainly throw it up there and see what happens. Other possibilities to consider are behavior if |
A small update on this - we've been running our servers with this fix since Wednesday last week, and so far haven't seen a panic nor the |
@OxleyS sounds promising. How frequent was it before the fix? |
It only happened once, so it must be some rather freak conditions that trigger it. |
Yeah. Let's just give it time. |
@OxleyS I rebased this PR off latest main so you can get both this fix and the other log changes. |
While I admit that I haven't been super diligently checking (with a vacation putting me out of the office for a while), I still haven't seen any panics nor log lines. How should we proceed? Personally I feel that whether it fixes #530 or not, this PR is good to have as a "just in case" guard (minus the logging of course). Especially since the happy path is almost certainly taken. I haven't done any benchmarking though. |
Yeah. Let's land it. I'll remove the logging and get it in later today. Thanks for checking! |
4d4d483
to
99479b3
Compare
This is a potential fix for #530.
The story here is that the openssl crate has an abstraction layer
SslStream
which is generic over something that implementsRead
/Write
. str0m is push/pull which means we need an "adapter" to convert between these two methods – that adapter is calledIoBuffer
.I have assumed the operation of the
IoBuffer
would be such that each time we push an incoming packet to it, theSslStream
needs to read that packet completely. The assertion tripped in #530 seem to indicate that doesn't always happen.This PR relaxes this assumption to allow
IoBuffer
to potentially hold a few unconsumed packets. Because there is no repro, this is a shot in the dark.