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

[sql-15] sessions: activate normal sessions in one go & add various functional options for NewSession #984

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ellemouton
Copy link
Member

As a follow up to #980, here we add a functional option for immediate session activation (ie, skip Reserved state and go straight to Created) for normal, non-autopilot sessions.

We also take the opportunity for some interface clean-up and convert a bunch of the NewSession parameters to functional ops.

TODO(elle): unit test for immediateActivate option

In this commit, we let StateReserved be the new initial state of a
session for when NewSession is called. We then do predicate checks for
linked sessions along with unique session alias (ID) and priv key
derivations all under the same DB transaction in NewSession.

CreateSession then moves a session to StateCreated. Only in StateCreated
does a session become usable.

With this change, we no longer need to ensure atomic session creation by
acquiring the `sessRegMu` mutex in the session RPC server.
This was used to check that all linked sessions are no longer
active before attempting to register an autopilot session. But this is
no longer needed since this is done within NewSession.
@ellemouton ellemouton self-assigned this Feb 20, 2025
@ellemouton ellemouton added the no-changelog This PR is does not require a release notes entry label Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog This PR is does not require a release notes entry sql-ize
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant