-
Notifications
You must be signed in to change notification settings - Fork 373
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
Send TCP protocol header to ignore non-rerun clients #6253
Conversation
Somewhat contrary to the original requirement this fix still emits a warning, although the warning says "Unknown client connected" instead of "The version is wrong". Please let me know if I need to silence the warning. |
Also please add labels. I am not sure if I can add them or how to do so. |
@rerun-bot full-check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Looks good, but yes, let's also catch ConnectionError::UnknownClient
and instead of logging at warn
, let's log at debug
for that particular case
@rerun-bot full-check |
Moved it to |
One thing I need to think through prior to merging is how this impacts the 0.15 -> 0.16 migration. My read of this code is this will break compatibillity in both directions. Given the existence of the current PROTOCOL_VERSION processing in legacy clients and servers, I think if it might be worth defining the new protocol order as:
Where HEADER_VERSION=0 means no rerun bytes, and HEADER_VERSION=1 means check for 0.15 client -> 0.16 server could then be detected by seeing a HEADER_VERSION of 0 in the stream, in which case it could skip checking for the 0.16 client -> 0.15 server would means the client would transmit:
which the legacy server would see as being a newer protocol and correctly report the error: Optionally we could have 0.16 clients continue to transmit HEADER_VERSION=0 for one release cycle, which would would make them backwards compatible with 0.15 (and correctly work with 0.16 due to the above backwards compatibility), and then prior to 0.17 switch them to sending the new style |
Thanks @jleibs. I had considered compat, but thought it is not going to be a problem in practice because the server and the client are shipped together so they won't go out of sync. But it is a good idea to implement it to avoid surprises nevertheless. Your suggested approach will definitely work, but I wonder if we could do it without requiring a new field What if we did this in 0.16:
The different client/server combinations will behave as follows then:
Obviously the limitation with this approach is that for the second combination (0.16 client/0.15 server) compat will have to break right now. We won't be able to wait until release 0.17 as you have suggested. But on the flip side it's a simpler scheme and IMHO a more natural evolution of the protocol because What do you think? |
@gurry that makes sense to me - sounds like a good compromise. |
Thanks. Will implement it in a couple of days as I'll be away. |
Sounds good -- however, depending on how things are going, one of us might pick up your branch and add that fix tomorrow since we're coming up against our release deadline. Will link here if so to avoid duplicate work. |
I had some time so just did it. |
@rerun-bot full-check |
The above check failure is during compilation to wasm and it looks like this:
It occurs because @jleibs, @emilk please suggest how I should address this. Should I move |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
I've tested it and it works great.
What
Now we send a special header in the TCP connection before sending the protocol version. It helps the server recognize if the client is a rerun client or something else.
Edit
Have changed the approach to send the header after the protocol version. See the discussion in comments.
Checklist
main
build: rerun.io/viewernightly
build: rerun.io/viewerTo run all checks from
main
, comment on the PR with@rerun-bot full-check
.