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

[Search] Session SO polling #84225

Merged
merged 44 commits into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
1c82050
Monitor ids
Nov 24, 2020
52032fc
import fix
Nov 24, 2020
60abe6c
Merge remote-tracking branch 'upstream/master' into sessions/retry-logic
Nov 25, 2020
8a12991
solve circular dep
Nov 25, 2020
d692c1e
eslint
Nov 30, 2020
9a02d9c
Merge branch 'master' of github.com:elastic/kibana into sessions/retr…
Nov 30, 2020
1092c7a
mock circular dep
Nov 30, 2020
500f15d
max retries test
Nov 30, 2020
c6fea68
mock circular dep
Nov 30, 2020
e5325e9
test
Nov 30, 2020
c540fde
jest <(-:C
Dec 1, 2020
5f7db2d
jestttttt
Dec 1, 2020
80fdf82
Merge branch 'master' of github.com:elastic/kibana into sessions/retr…
Dec 1, 2020
4886819
[data.search] Move search method inside session service and add tests
lukasolson Dec 1, 2020
7387405
Merge branch 'master' of github.com:elastic/kibana into sessions/retr…
Dec 2, 2020
a91ea10
merge
Dec 2, 2020
0de7730
Move background session service to data_enhanced plugin
lukasolson Dec 2, 2020
5253b42
Merge branch 'master' of github.com:elastic/kibana into sessions/retr…
Dec 3, 2020
ec54b8b
Merge branch 'master' into search-session-search
lukasolson Dec 3, 2020
4ff6eaf
Merge branch 'search-session-search' into search-session-enhanced
lukasolson Dec 3, 2020
93128a1
Better logs
Dec 3, 2020
ea14d29
Fix types
lukasolson Dec 3, 2020
4ce9fef
Merge branch 'master' into search-session-enhanced
lukasolson Dec 3, 2020
7537e69
Merge branch 'master' into search-session-enhanced
kibanamachine Dec 3, 2020
53b8c32
Merge branch 'master' into search-session-enhanced
kibanamachine Dec 4, 2020
a0e2142
Space aware session service
Dec 6, 2020
54b440a
Merge branch 'master' of github.com:elastic/kibana into sessions/retr…
Dec 6, 2020
e8ec140
Merge remote-tracking branch 'lukasolson/search-session-enhanced' int…
Dec 6, 2020
149d94e
ts
Dec 6, 2020
0b875ac
Fix session service saving
Dec 7, 2020
f40fcca
Merge branch 'master' of github.com:elastic/kibana into sessions/retr…
Dec 7, 2020
c1ba50c
Merge remote-tracking branch 'upstream/master' into sessions/retry-logic
Dec 7, 2020
b5b0895
merge fix
Dec 7, 2020
f14f042
stable stringify
Dec 7, 2020
5b9782d
INMEM_MAX_SESSIONS
Dec 7, 2020
0858b98
INMEM_MAX_SESSIONS
Dec 7, 2020
6c9e345
Merge branch 'master' of github.com:elastic/kibana into sessions/retr…
Dec 8, 2020
e85da48
Merge branch 'sessions/retry-logic' of github.com:lizozom/kibana into…
Dec 8, 2020
4876f3d
Update x-pack/plugins/data_enhanced/server/search/session/session_ser…
lizozom Dec 8, 2020
ffabaa9
Update x-pack/plugins/data_enhanced/server/search/session/session_ser…
lizozom Dec 8, 2020
63c7d6a
Use setTimeout to schedule monitoring steps
Dec 8, 2020
51143af
Merge branch 'master' of github.com:elastic/kibana into sessions/retr…
Dec 8, 2020
bf54579
Merge branch 'master' of github.com:elastic/kibana into sessions/retr…
Dec 9, 2020
07fe4bf
settimeout
Dec 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@

import Chance from 'chance';

import { getUpgradeableConfigMock } from './get_upgradeable_config.test.mock';
import { SavedObjectsErrorHelpers } from '../../saved_objects';
import { savedObjectsClientMock } from '../../saved_objects/service/saved_objects_client.mock';
import { loggingSystemMock } from '../../logging/logging_system.mock';
import { getUpgradeableConfigMock } from './get_upgradeable_config.test.mock';

import { createOrUpgradeSavedConfig } from './create_or_upgrade_saved_config';

Expand Down
6 changes: 4 additions & 2 deletions src/plugins/data/server/search/search_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,15 @@ export class SearchService implements Plugin<ISearchSetup, ISearchStart> {
private readonly searchSourceService = new SearchSourceService();
private defaultSearchStrategyName: string = ES_SEARCH_STRATEGY;
private searchStrategies: StrategyMap = {};
private sessionService: ISessionService;
private coreStart?: CoreStart;
private sessionService: ISessionService = new SessionService();

constructor(
private initializerContext: PluginInitializerContext<ConfigSchema>,
private readonly logger: Logger
) {}
) {
this.sessionService = new SessionService();
}

public setup(
core: CoreSetup<{}, DataPluginStart>,
Expand Down
13 changes: 10 additions & 3 deletions x-pack/plugins/data_enhanced/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ interface SetupDependencies {

export class EnhancedDataServerPlugin implements Plugin<void, void, SetupDependencies> {
private readonly logger: Logger;
private sessionService!: BackgroundSessionService;

constructor(private initializerContext: PluginInitializerContext) {
this.logger = initializerContext.logger.get('data_enhanced');
Expand All @@ -53,20 +54,26 @@ export class EnhancedDataServerPlugin implements Plugin<void, void, SetupDepende
eqlSearchStrategyProvider(this.logger)
);

this.sessionService = new BackgroundSessionService(this.logger);

deps.data.__enhance({
search: {
defaultStrategy: ENHANCED_ES_SEARCH_STRATEGY,
sessionService: new BackgroundSessionService(),
sessionService: this.sessionService,
},
});

const router = core.http.createRouter();
registerSessionRoutes(router);
}

public start(core: CoreStart) {}
public start(core: CoreStart) {
this.sessionService.start(core, this.initializerContext.config.create());
Copy link
Member

Choose a reason for hiding this comment

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

At some point, should we make SessionService and BackgroundSessionService actual services (that implement Plugin)? Doesn't need to be part of this PR, just my thoughts.

}

public stop() {}
public stop() {
this.sessionService.stop();
}
}

export { EnhancedDataServerPlugin as Plugin };
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export const backgroundSessionMapping: SavedObjectsType = {
hidden: true,
mappings: {
properties: {
sessionId: {
type: 'keyword',
},
name: {
type: 'keyword',
},
Expand Down
Loading