Skip to content

[task manager] Kibana should start without task manager#48568

Merged
wylieconlon merged 6 commits intoelastic:masterfrom
wylieconlon:no-fail-without-tasks
Oct 25, 2019
Merged

[task manager] Kibana should start without task manager#48568
wylieconlon merged 6 commits intoelastic:masterfrom
wylieconlon:no-fail-without-tasks

Conversation

@wylieconlon
Copy link
Copy Markdown
Contributor

Closes #48451

The task manager is indicated as a hard dependency of maps and oss_telemetry, and those apps will fail to start when xpack.task_manager.enabled: false is set. This causes Kibana to fail to start in those scenarios.

This PR removes the task_manager dependency from the requires property, and adds a more dynamic check for whether the task manager is enabled. This allow the server to start in these scenarios.

@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-stack-services (Team:Stack Services)

@tsullivan
Copy link
Copy Markdown
Member

Being able to record telemetry shouldn't be a hard requirement for any plugin, so I am in favor of this change.

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Copy link
Copy Markdown
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

Looks like you need to return early for null task_manager in one more location

initTelemetryCollection passes server.plugins.task_manager and scheduleTask does not expect taskManager to be null.

@wylieconlon wylieconlon requested a review from nreese October 22, 2019 18:14
Copy link
Copy Markdown
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

Maps changes look good

lgtm
code review

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

const taskManager = server.plugins.task_manager;

if (!taskManager) {
server.log(['warning', 'telemetry'], `Task manager is not available`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I dont think we should be logging a warning if the task manager is not available, maybe a debug

@wylieconlon wylieconlon requested a review from Bamieh October 24, 2019 21:27
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Copy link
Copy Markdown
Contributor

@chrisdavies chrisdavies left a comment

Choose a reason for hiding this comment

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

LGTM w/ possible unimportant, nit-picky tweak.

state: { byDate: {}, suggestionsByDate: {}, saved: {}, runs: 0 },
params: {},
});
if (taskManager) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd lift this up to line 67 or thereabouts, so we don't even register an afterPluginsInit if there is no task manager.

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@wylieconlon wylieconlon merged commit 58dbb13 into elastic:master Oct 25, 2019
@wylieconlon wylieconlon deleted the no-fail-without-tasks branch October 25, 2019 16:42
wylieconlon pushed a commit to wylieconlon/kibana that referenced this pull request Oct 25, 2019
* [task manager] Kibana should not fail to start without task manager

* Check for task manager in maps

* Lower log level

* Update task registration
wylieconlon pushed a commit to wylieconlon/kibana that referenced this pull request Oct 25, 2019
* [task manager] Kibana should not fail to start without task manager

* Check for task manager in maps

* Lower log level

* Update task registration
wylieconlon pushed a commit that referenced this pull request Oct 25, 2019
)

* [task manager] Kibana should not fail to start without task manager

* Check for task manager in maps

* Lower log level

* Update task registration
wylieconlon pushed a commit that referenced this pull request Oct 25, 2019
)

* [task manager] Kibana should not fail to start without task manager

* Check for task manager in maps

* Lower log level

* Update task registration
@chrisronline chrisronline mentioned this pull request Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Telemetry] When task manager plugin is disabled, Kibana refuses to start

6 participants