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

FIX: Session_Manager::find_all() is inefficient #3451

Merged
merged 3 commits into from
Mar 29, 2023

Conversation

reneme
Copy link
Collaborator

@reneme reneme commented Mar 28, 2023

Now that we're talking about the efficiency of the Session_Manager class hierarchy: This is likely something that should go in before the release candidate. It replaces Session_Manager::find_all() with ::find_some().

Technically, nothing would have forced application-defined session managers to actually always return "all" found sessions, but the method name very much implied that. Instead, it is now called find_some() and gets a "max sessions hint" that implementations can (and should) follow.

Additionally, the Session_Manager base class now has some mechanics to call find_some() more than once if the returned Session objects don't pass its filters -- currently mainly a session expiry check. This algorithm might see some evolution, but I think the find_some() interface is more versatile and better suited.

@reneme reneme added this to the Botan 3.0.0 milestone Mar 28, 2023
@reneme reneme mentioned this pull request Mar 28, 2023
29 tasks
@reneme reneme force-pushed the tls13/session_manager_find_all branch from 95b908e to b16b6ff Compare March 28, 2023 16:45
@reneme
Copy link
Collaborator Author

reneme commented Mar 28, 2023

Rebased after merging #3450.

@codecov-commenter
Copy link

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01 ⚠️

Comparison is base (d463bbb) 88.23% compared to head (b16b6ff) 88.23%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3451      +/-   ##
==========================================
- Coverage   88.23%   88.23%   -0.01%     
==========================================
  Files         618      618              
  Lines       70313    70322       +9     
  Branches     6870     6872       +2     
==========================================
+ Hits        62041    62048       +7     
- Misses       5415     5419       +4     
+ Partials     2857     2855       -2     
Impacted Files Coverage Δ
...ib/pubkey/dilithium/dilithium_common/dilithium.cpp 90.94% <ø> (ø)
...c/lib/tls/sessions_sql/tls_session_manager_sql.cpp 71.03% <100.00%> (+0.20%) ⬆️
src/lib/tls/tls_session_manager.cpp 98.50% <100.00%> (+0.17%) ⬆️
src/lib/tls/tls_session_manager_memory.cpp 84.74% <100.00%> (+0.26%) ⬆️
src/tests/test_tls_rfc8448.cpp 93.44% <100.00%> (ø)
src/tests/test_tls_session_manager.cpp 95.63% <100.00%> (ø)

... and 5 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@randombit randombit merged commit b46af1a into master Mar 29, 2023
@randombit randombit deleted the tls13/session_manager_find_all branch March 29, 2023 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants