Skip to content

Commit

Permalink
remove ephemeral task from task manager
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaweiWu committed Nov 22, 2024
1 parent d697a67 commit 67f138e
Show file tree
Hide file tree
Showing 45 changed files with 85 additions and 2,922 deletions.
70 changes: 58 additions & 12 deletions x-pack/plugins/task_manager/server/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ describe('config validation', () => {
"active_nodes_lookback": "30s",
"interval": 10000,
},
"ephemeral_tasks": Object {
"enabled": false,
"request_capacity": 10,
},
"event_loop_delay": Object {
"monitor": true,
"warn_threshold": 5000,
Expand Down Expand Up @@ -82,10 +78,6 @@ describe('config validation', () => {
"active_nodes_lookback": "30s",
"interval": 10000,
},
"ephemeral_tasks": Object {
"enabled": false,
"request_capacity": 10,
},
"event_loop_delay": Object {
"monitor": true,
"warn_threshold": 5000,
Expand Down Expand Up @@ -143,10 +135,6 @@ describe('config validation', () => {
"active_nodes_lookback": "30s",
"interval": 10000,
},
"ephemeral_tasks": Object {
"enabled": false,
"request_capacity": 10,
},
"event_loop_delay": Object {
"monitor": true,
"warn_threshold": 5000,
Expand Down Expand Up @@ -296,4 +284,62 @@ describe('config validation', () => {
`"[discovery.active_nodes_lookback]: active node lookback duration cannot exceed five minutes"`
);
});

test('should not throw if ephemeral_tasks is defined', () => {
const config: Record<string, unknown> = {
ephemeral_tasks: {
enabled: true,
request_capacity: 20,
},
};

expect(configSchema.validate(config)).toMatchInlineSnapshot(`
Object {
"allow_reading_invalid_state": true,
"auto_calculate_default_ech_capacity": false,
"claim_strategy": "mget",
"discovery": Object {
"active_nodes_lookback": "30s",
"interval": 10000,
},
"ephemeral_tasks": Object {
"enabled": true,
"request_capacity": 20,
},
"event_loop_delay": Object {
"monitor": true,
"warn_threshold": 5000,
},
"kibanas_per_partition": 2,
"max_attempts": 3,
"metrics_reset_interval": 30000,
"monitored_aggregated_stats_refresh_rate": 60000,
"monitored_stats_health_verbose_log": Object {
"enabled": false,
"level": "debug",
"warn_delayed_task_start_in_seconds": 60,
},
"monitored_stats_required_freshness": 4000,
"monitored_stats_running_average_window": 50,
"monitored_task_execution_thresholds": Object {
"custom": Object {},
"default": Object {
"error_threshold": 90,
"warn_threshold": 80,
},
},
"poll_interval": 500,
"request_capacity": 1000,
"request_timeouts": Object {
"update_by_query": 30000,
},
"unsafe": Object {
"authenticate_background_task_utilization": true,
"exclude_task_types": Array [],
},
"version_conflict_threshold": 80,
"worker_utilization_running_average_window": 5,
}
`);
});
});
13 changes: 2 additions & 11 deletions x-pack/plugins/task_manager/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export const DEFAULT_MAX_WORKERS = 10;
export const DEFAULT_POLL_INTERVAL = 3000;
export const MGET_DEFAULT_POLL_INTERVAL = 500;
export const DEFAULT_VERSION_CONFLICT_THRESHOLD = 80;
export const DEFAULT_MAX_EPHEMERAL_REQUEST_CAPACITY = MAX_WORKERS_LIMIT;

// Monitoring Constants
// ===================
Expand Down Expand Up @@ -100,16 +99,8 @@ export const configSchema = schema.object(
max: MAX_DISCOVERY_INTERVAL_MS,
}),
}),
ephemeral_tasks: schema.object({
enabled: schema.boolean({ defaultValue: false }),
/* How many requests can Task Manager buffer before it rejects new requests. */
request_capacity: schema.number({
// a nice round contrived number, feel free to change as we learn how it behaves
defaultValue: 10,
min: 1,
max: DEFAULT_MAX_EPHEMERAL_REQUEST_CAPACITY,
}),
}),
/* Allows for old kibana config to start kibana without crashing since ephemeral tasks are deprecated*/
ephemeral_tasks: schema.maybe(schema.any()),
event_loop_delay: eventLoopDelaySchema,
kibanas_per_partition: schema.number({
defaultValue: DEFAULT_KIBANAS_PER_PARTITION,
Expand Down

This file was deleted.

Loading

0 comments on commit 67f138e

Please sign in to comment.