-
Notifications
You must be signed in to change notification settings - Fork 98
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
Conversation
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
Not specific to this PR, but:
Sounds like we should tackle a project to remove as much of the async locking as possible. (Maybe after we have a performance testbed?) |
@@ -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)); |
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.
Noice.
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.
I love this refactor 👍🏻
Had one small suggestion, but don't want to block merging. Feel free to choose if appropriate.
Co-authored-by: Mark Mandel <markmandel@google.com>
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