Skip to content
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

Merge sessions map and pruning logic #224

Merged
merged 3 commits into from
Apr 15, 2021
Merged

Merge sessions map and pruning logic #224

merged 3 commits into from
Apr 15, 2021

Conversation

iffyio
Copy link
Collaborator

@iffyio iffyio commented Apr 9, 2021

Currently sessions management logic is mixed in with the actual server
so this moves it out to a separate SessionManager.

I originally wanted to re-use this SessionManager to add
session affinity to the load balancer but quickly realised that this
wouldn't be possible currently because looking up a session is
unfortunately async (due to locking) and filters aren't async. Not
currently sure how we'd want to tackle this issue, atm at least would rather not
do an async Filter trait since that brings other issues and we might
end up with a perf regression spawning a new task per packet

Currently sessions management logic is mixed in with the actual server
so this moves it out to a separate SessionManager.

I originally wanted to re-use this SessionManager to add
session affinity to the load balancer but quickly realised that this
wouldn't be possible currently because looking up a session is
unfortunately async (due to locking) and filters aren't async. Not
currently sure how we'd want to tackle this issue, atm at least would rather not
do an async Filter trait since that brings other issues and we might
end up with a perf regression spawning a new task per packet
@iffyio iffyio requested a review from markmandel April 9, 2021 06:34
@google-cla google-cla bot added the cla: yes label Apr 9, 2021
@markmandel
Copy link
Contributor

Not specific to this PR, but:

I originally wanted to re-use this SessionManager to add session affinity to the load balancer but quickly realised that this
wouldn't be possible currently because looking up a session is unfortunately async (due to locking)

Sounds like we should tackle a project to remove as much of the async locking as possible. (Maybe after we have a performance testbed?)

@markmandel markmandel added the kind/cleanup Refactoring code, fixing up documentation, etc label Apr 13, 2021
@@ -357,7 +351,7 @@ mod tests {
.unwrap()
.as_secs();
let diff = initial_expiration_secs - now_secs;
assert!(diff >= 15 && diff <= 20);
assert!((15..21).contains(&diff));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noice.

Copy link
Contributor

@markmandel markmandel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this refactor 👍🏻

Had one small suggestion, but don't want to block merging. Feel free to choose if appropriate.

iffyio and others added 2 commits April 14, 2021 07:46
@markmandel markmandel merged commit a346b74 into main Apr 15, 2021
@markmandel markmandel deleted the iu/session-manager branch April 15, 2021 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes kind/cleanup Refactoring code, fixing up documentation, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants