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

X-pack licensing plugin issues too many duplicate requests on page load #79618

Closed
shahzad31 opened this issue Oct 6, 2020 · 5 comments · Fixed by #79645
Closed

X-pack licensing plugin issues too many duplicate requests on page load #79618

shahzad31 opened this issue Oct 6, 2020 · 5 comments · Fixed by #79645
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:License Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@shahzad31
Copy link
Contributor

shahzad31 commented Oct 6, 2020

Kibana version:

Master

Original install method (e.g. download page, yum, from source, etc.):
Source

Describe the bug:

When for example Observability homepage is loaded, it has too many requests for licensing info originating from x-pack/licensing plugin.

In below example there are 9 xhr requests for same api.

image

This is the URL it calls
http://localhost:5601/api/licensing/info

There should be only one request to get license info.

@shahzad31 shahzad31 added Feature:License bug Fixes for quality problems that affect the customer experience Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc labels Oct 6, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@pgayvallet
Copy link
Contributor

There should be only one request to get license info.

Not really. We are using pooling and manual triggers to stay sync with the server's state.

However having 7 requests during startup seems a lot. @restrry I guess it is not expected? Do you know what could cause that?

@shahzad31
Copy link
Contributor Author

it's actually 9 requests on page load in above example :)

Alright i was not aware of pooling to sync with server state.

@mshustov
Copy link
Contributor

mshustov commented Oct 6, 2020

@restrry I guess it is not expected?

no, it's not expected behaviour. We even have a test to ensure we do not over-fetch

it('new subscriptions does not force re-fetch', async () => {

The root problem is Observability plugin uses http.fetch to perform AJAX request to 3rd party service https://feeds.elastic.co/observability-solution/..., which is not supported at the moment.

* A function for making an HTTP requests to Kibana's backend. See {@link HttpFetchOptions} for options and

Because response doesn't contain kbn-license-sig header, this condition gives a false positive
if (this.prevSignature !== signatureHeader) {

We should:

  • handle the case when kbn-license-sig header is not present
  • log a warning when fetch used against non-Kibana backend

@joshdover
Copy link
Contributor

log a warning when fetch used against non-Kibana backend

Honestly, we should probably throw an error. I'm surprised this works tbh. There are a lot of assumptions in that service and registered interceptors that this is only used for requests against Kibana's backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:License Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants