-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
⚡️ zb: Pipeline client-side handshake as much as possible #683
Conversation
80fcf3f
to
4d1bcef
Compare
@kas (I assume you're this guy) Hi there, seems the gdbus doesn't really correctly do handshake and pipelining handshake breaks there. While I was more than happy to add the support for that but if supporting the special gdbus session bus means we don't get to do smart things in zbus, I'd rather remove the support (or be OK with it being broken until gdbus is fixed). |
d8757f5
to
48e3cae
Compare
They're already run in the setup step before.
48e3cae
to
ce2e5ab
Compare
Oh never mind. The issue seems reproducible with dbus-daemon as well. I need to make the pipelining be able handle disconnection from the server, as well. |
0799845
to
9694445
Compare
9694445
to
c9eae0d
Compare
3fe0618
to
25307e6
Compare
Seems I was right about GDBus being unable to handle pipelining. It requires BEGIN command to be sent separately after client receive OK on the authentication. Fortunately, the workaround is not too dirty. |
We now send `DATA`, `NEGOTIATE_UNIX_FD` and `BEGIN` commands at once. This reduces latency and hence improves performance. It would have been the best to send all the commands at the same time, but seems dbus-daemon kick us out if we send multiple commands after it rejects the auth command. It wants us to negotiate the auth first. We could in theory just reconnect but that would require some achitectural changes and rethinking the code. Moreover cookie auth requires a round-trip to the server to get the cookie context first so we can't fully pipeline that one. Furthermore, gdbus is not able to handle `BEGIN` sent along with `DATA`, so we have to send `BEGIN` separately when gdbus feature is enabled on Windows. The server side is not possible to pipeline as it the server just responds to commands from the client and it can not assume that clients will always pipeline all commands. Fixes dbus2#493.
Otherwise it messes up the logging output.
If a received command from the client is unknown or invalid in the current context, we shouldn't completely error out but rather send an error and continue as if nothing happened.
If the client sends a `CANCEL` command during a handshake, the server must move on to the handshake method available (if any). The exact wording in the spec: > On receiving the CANCEL command, the server must send a REJECTED > command and abort the current authentication exchange.
25307e6
to
73797b7
Compare
We now send
DATA
,NEGOTIATE_UNIX_FD
andBEGIN
commands at once. This reduces latency and hence improves performance.It would have been the best to send all the commands at the same time, but seems dbus-daemon kick us out if we send multiple commands after it rejects the auth command. It wants us to negotiate the auth first. We could in theory just reconnect but that would require some architectural changes and rethinking the code.
Moreover cookie auth requires a round-trip to the server to get the cookie context first so we can't fully pipeline that one.
The server side is not possible to pipeline as it the server just responds to commands from the client and it can not assume that clients will always pipeline all commands.
Fixes #493.