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 Sessions] Split tasks #99967

Merged
merged 59 commits into from
Jun 24, 2021
Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
12b95ab
cancel the previous session
May 10, 2021
a42fe88
split to 3 tasks
May 12, 2021
6e870dd
fixes
May 12, 2021
f740bad
Merge branch 'session/cancellation' into sessions/split-tasks
May 12, 2021
436dd51
cancellation
May 13, 2021
984eba2
Merge branch 'master' of github.com:elastic/kibana into session/cance…
May 13, 2021
2a58ae8
Merge branch 'session/cancellation' into sessions/split-tasks
May 13, 2021
8afc649
updated tests
May 13, 2021
bc3788b
split out and improve jest tests
May 13, 2021
f5fdd88
Merge branch 'master' into session/cancellation
kibanamachine May 13, 2021
768d7ed
Merge branch 'master' into session/cancellation
kibanamachine May 16, 2021
9fffc11
Merge branch 'master' of github.com:elastic/kibana into sessions/spli…
May 16, 2021
77624ff
Merge branch 'master' of github.com:elastic/kibana into session/cance…
May 18, 2021
e5904ac
cleanup previous session properly
May 18, 2021
4f32b09
Merge branch 'master' of github.com:elastic/kibana into session/cance…
May 18, 2021
f9f1ebb
Merge branch 'session/cancellation' of github.com:lizozom/kibana into…
May 18, 2021
44023c4
don't fail delete and cancel if item was already cleaned up
May 18, 2021
6067d69
Merge branch 'session/cancellation' into sessions/split-tasks
May 18, 2021
54bb6cd
test
May 19, 2021
9ffbb03
test
May 19, 2021
6de0b62
Merge branch 'master' of github.com:elastic/kibana into session/cance…
May 19, 2021
a343e13
Merge branch 'master' into session/cancellation
kibanamachine May 19, 2021
6d96554
Merge branch 'master' into session/cancellation
kibanamachine May 19, 2021
49fe28a
Merge branch 'master' into session/cancellation
kibanamachine May 20, 2021
b3e093a
Merge branch 'master' of github.com:elastic/kibana into session/cance…
May 23, 2021
f911163
Merge branch 'session/cancellation' of github.com:lizozom/kibana into…
May 23, 2021
a988edd
Merge branch 'master' into session/cancellation
kibanamachine May 24, 2021
25445c6
ignore resource_not_found_exception when deleting an already cleared …
May 24, 2021
e1db913
Merge branch 'session/cancellation' of github.com:lizozom/kibana into…
May 24, 2021
93910b7
Merge branch 'session/cancellation' into sessions/split-tasks
May 24, 2021
6beddb6
jest
May 24, 2021
fecd856
update jest
May 25, 2021
0b35543
api int
May 25, 2021
7e73984
Merge branch 'master' of github.com:elastic/kibana into sessions/spli…
Jun 1, 2021
c13e860
Merge branch 'master' into sessions/split-tasks
kibanamachine Jun 2, 2021
c6b2d47
git pullMerge branch 'master' of github.com:elastic/kibana into sessi…
Jun 2, 2021
855f983
Merge branch 'sessions/split-tasks' of github.com:lizozom/kibana into…
Jun 2, 2021
41e0e4f
Merge branch 'master' into sessions/split-tasks
kibanamachine Jun 6, 2021
de19e59
Merge branch 'master' into sessions/split-tasks
kibanamachine Jun 6, 2021
8ec222b
Merge branch 'master' of github.com:elastic/kibana into sessions/spli…
Jun 7, 2021
0765ea3
Merge branch 'sessions/split-tasks' of github.com:lizozom/kibana into…
Jun 7, 2021
6ef8a41
fix jest
Jun 7, 2021
ec69de7
testssss
Jun 7, 2021
881af3d
Merge branch 'master' into sessions/split-tasks
kibanamachine Jun 10, 2021
b04bbc0
Merge branch 'master' of github.com:elastic/kibana into sessions/spli…
Jun 10, 2021
242f34d
Code review @dosant
Jun 14, 2021
0d2558a
Merge branch 'master' of github.com:elastic/kibana into sessions/spli…
Jun 14, 2021
5e29779
Merge branch 'sessions/split-tasks' of github.com:lizozom/kibana into…
Jun 14, 2021
84965b8
types
Jun 14, 2021
b05aad3
remove any
Jun 14, 2021
14da890
Fix merge
Jun 14, 2021
cd1907b
type
Jun 14, 2021
820a6ac
Merge branch 'master' of github.com:elastic/kibana into sessions/spli…
Jun 14, 2021
04903af
Merge branch 'master' of github.com:elastic/kibana into sessions/spli…
Jun 15, 2021
dbcf019
test
Jun 15, 2021
9b5c7a4
Merge branch 'master' into sessions/split-tasks
kibanamachine Jun 16, 2021
1738463
Merge branch 'master' of github.com:elastic/kibana into sessions/spli…
Jun 23, 2021
6af8231
jest
Jun 23, 2021
49e8334
git pushMerge branch 'sessions/split-tasks' of github.com:lizozom/kib…
Jun 23, 2021
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
12 changes: 11 additions & 1 deletion src/plugins/data/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,20 @@ export const searchSessionsConfigSchema = schema.object({
*/
pageSize: schema.number({ defaultValue: 100 }),
/**
* trackingInterval controls how often we track search session objects progress
* trackingInterval controls how often we track persisted search session objects progress
*/
trackingInterval: schema.duration({ defaultValue: '10s' }),

/**
* cleanupInterval controls how often we track non-persisted search session objects for cleanup
*/
cleanupInterval: schema.duration({ defaultValue: '60s' }),

/**
* expireInterval controls how often we track persisted search session objects for expiration
*/
expireInterval: schema.duration({ defaultValue: '60m' }),

/**
* monitoringTaskTimeout controls for how long task manager waits for search session monitoring task to complete before considering it timed out,
* If tasks timeouts it receives cancel signal and next task starts in "trackingInterval" time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ describe('Session service', () => {
expect(nowProvider.reset).toHaveBeenCalled();
});

it("Can't clear other apps' session", async () => {
sessionService.start();
expect(sessionService.getSessionId()).not.toBeUndefined();
currentAppId$.next('change');
sessionService.clear();
expect(sessionService.getSessionId()).not.toBeUndefined();
});

it("Can start a new session in case there is other apps' stale session", async () => {
const s1 = sessionService.start();
expect(sessionService.getSessionId()).not.toBeUndefined();
Expand Down
12 changes: 12 additions & 0 deletions src/plugins/data/public/search/session/session_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,18 @@ export class SessionService {
* Cleans up current state
*/
public clear() {
// make sure apps can't clear other apps' sessions
const currentSessionApp = this.state.get().appName;
if (currentSessionApp && currentSessionApp !== this.currentApp) {
// eslint-disable-next-line no-console
console.warn(
`Skip clearing session "${this.getSessionId()}" because it belongs to a different app. current: "${
this.currentApp
}", owner: "${currentSessionApp}"`
);
return;
lizozom marked this conversation as resolved.
Show resolved Hide resolved
}

this.state.transitions.clear();
this.searchSessionInfoProvider = undefined;
this.searchSessionIndicatorUiConfig = undefined;
Expand Down
Loading