-
Notifications
You must be signed in to change notification settings - Fork 24
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
Detach batcher and direct feature #996
Detach batcher and direct feature #996
Conversation
1fc2a69
to
e11fb52
Compare
e11fb52
to
8c1bfb0
Compare
8c1bfb0
to
0a21893
Compare
0a21893
to
1d716f8
Compare
1d716f8
to
2706f0a
Compare
2706f0a
to
77232d6
Compare
77232d6
to
208e05a
Compare
208e05a
to
b64cc85
Compare
b64cc85
to
3d172c1
Compare
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.
+0.5
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.
+1.0
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.
Looks good in general. Very nice commit structure. But I don't like this approach to testing. It does not scale. It's ok in UTs, we can leave it there, but I would really rework the nat-lab part
3d172c1
to
f62848b
Compare
f62848b
to
10ae6c7
Compare
10ae6c7
to
a339eb2
Compare
a339eb2
to
9228b5b
Compare
9228b5b
to
ed95223
Compare
ed95223
to
03de9c2
Compare
03de9c2
to
e2ecc6b
Compare
e2ecc6b
to
b0e5359
Compare
Batcher feature works by employing SessionKeeper however since it's under a direct feature flag it means that without enabling it as well, there's a failure. This commit introduces a testcase that highlights that and at the moment fails to pass. Signed-off-by: Lukas Pukenis <[email protected]>
SessionKeeper is solely used for Direct connections and thus only enabled when Direct feature is enabled. However since it is very minimal, it makes sense to augment it for use in batching more things. This commit moves out SessionKeeper out from Direct struct to the parent structure and is always present from now on. Signed-off-by: Lukas Pukenis <[email protected]>
SessionKeeper log refactored to be easier to follow. Also introduces calls to SessionKeeper if batching is enabled when upgrading from Proxying to Direct and vice-versa. Current solution because the key is the same skips that and misaligns the keepalives which is an easy win. A bunch of testcases are augmented with batching parameter Signed-off-by: Lukas Pukenis <[email protected]>
Signed-off-by: Lukas Pukenis <[email protected]>
SessionKeeper might fail as indicated by a failing test on MacOS without this commit. When failing the previous behaviour was to set direct entities to None and disable the functionality. This commit reintroduces behaviour and also toggles batching feature off since keepalives will rely on it. Signed-off-by: Lukas Pukenis <[email protected]>
Proxying persistent keepalives are being done by batcher when batching is used. Batcher uses ICMP echo requests(pings) which is a different mechanism from wireguard backend's keepalives. To ensure those are being emitted the testcase uses link detection and stops the peer. Given that there's no other generated traffic it should trigger link detection pretty soon and prove that batcher works correctly at least to some degree. Signed-off-by: Lukas Pukenis <[email protected]>
Signed-off-by: Lukas Pukenis <[email protected]>
16efa59
to
aee6ac6
Compare
Batching relies on Sessionkeeper(is baked into it) which is not present when direct feature is disabled or if SessionKeeper::start fails.
This breaks cases where batching is enabled but direct feature is not for VPN reestablishment for example(added testcases fail on
main
). This is a limitation of the decision to keep SessionKeeper instead of introducing a separate entity for batching.The fix is to override the batching feature when either SessionKeeper or Direct are None which is done here.
However I did an extra step and moved SessionKeeper outside the Direct entities as I think it doesn't belong there anymore due to being repurposed for more stuff(vpn, proxy, stun keepalives when batching, derp keepalives in progress). This moving out provided very minimal changes, though the diff looks huge.
Please see individual commits for more details
☑️ Definition of Done checklist