[data.search.session] Change search session client to implement plugin #86815
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR changes the way that the
data
pluginsearch
service implements thesession
service. Prior to this PR, thesession
service didn't implement theplugin
lifecycle (in either the OSS or enhanced versions).In doing so, it also adds the
cancel
logic to thesession
service, which in the enhanced version, will actually remove it from the search mapping.This paves the way to add additional methods directly on the
session
service, likeextend
(see #87370)./begin braindump
The OSS session service/x-pack background session service can’t follow the normal plugin lifecycle/types. Here’s why:
setup
, it callssetup
of session servicesetup
it callssetup
of background session serviceenhance
with new background session serviceI don’t really like the pattern of “enhancing” using a whole service, since it makes handling the lifecycle really funky… You have to call
setup
in the enhanced plugin, but then do you callstop
on OSS when enhancing? And do you callstop
in OSS or enhanced for the enhanced plugin?I guess all it really means is the enhanced session service can’t extend OSS session service.
/end braindump
Checklist