elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.72k stars 8.14k forks source link

Browser hang with Histogram with numeric interval less than 1 #36328

Closed antcodd closed 5 years ago

antcodd commented 5 years ago

Kibana version: 7.0.1

Elasticsearch version: 7.0.1

Server OS version: CentOS 7.6 running Elastic's kibana-oss docker container.

Browser version: Chrome 74 and Firefox 63

Browser OS version: Windows 10 and Ubuntu 16.04

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

Describe the bug: Browser tab freezes in what appears to be an infinite loop any time a Histogram visualization is rendered with interval set to less than 1 (e.g. 0.5). Eventually the tab runs out of memory. This includes dashboards with existing visualizations that worked in 6.7 and the visualization editor.

What seems to be happening is at some point ordered.interval has been incorrectly converted to "0.5 milliseconds", which causes orderXValues() to incorrectly fall into the dateInterval code path and goes into an infinite or very large loop comparing a time interval against numeric data.

Steps to reproduce:

  1. Create a Visualization with Histogram aggregation with metric set to a numeric field.
  2. Set histogram aggregation interval to 0.5
  3. Click apply button
  4. Browser tab freezes indefinitely
  5. Breaking execution shows javascript stuck in a loop inside orderXvalues()

Expected behavior: Histogram with interval 0.5 is displayed. This worked in 6.7 and earlier.

May be related to #34975/#35247

elasticmachine commented 5 years ago

Pinging @elastic/kibana-app

kertal commented 5 years ago

I can't reproduce it locally, @antcodd could you provide more details? maybe some screens with the settings you're using in your visualization. also details about the data you're querying would be useful. thx a lot

kertal commented 5 years ago

@thomasneirynck could you reproduce this issue, I couldn't. thx

GasparQ commented 5 years ago

I have the same issue on Kibana 7.0.1.

I tried several options.

Bar chart

For information, the distribution it try to plot contains only 15 buckets for a interval of 1 so it's not about the massiveness of data.

Network profiler

Google Chrome network profiler tells me that the request received a response 200 but when I check the response body, it's blank.

After a while, Chrome raise the error Paused before potential out-of-memory crash in line 73 of file vendors.bundle.dll.js.

I then check the response body again, and it was present and contains only the 30 buckets of the aggregation (as expected).

Datatable

I wanted to check if this problem was the same on other visualizations and the response is NO.

I tried the same aggregation (intervall 0.5) on a datatable, and it works perfectly.

Line chart

To push the investigation further, I tried to reproduce the bug on a Line chart visualization, and there is the issue.

I did not tried on other.

Conclusion

There is a difference between Datatable aggregation treatments and Bar chart (Line chart and maybe other) treatement.

This difference make kibana crash on Google Chrome and Firefox.

Would you like a dataset with an elastic mapping to reproduce the bug ?

kertal commented 5 years ago

That would be perfect, thank you so much!

Quentin_Gasparotto notifications@github.com schrieb am Di. 11. Juni 2019 um 10:23:

I have the same issue on Kibana 7.0.1.

I tried several options. Bar chart

  • Create a bar chart visualisation
  • Add a new X-axis with Histogram aggregation on a double or float field (both works)
  • Set the interval to 1 -> it works
  • Set the interval to 1.5 -> it works
  • Set the interval to 0.5 -> the UI freeze

For information, the distribution it try to plot contains only 15 buckets for a interval of 1 so it's not about the massiveness of data. Network profiler

Google Chrome network profiler tells me that the request received a response 200 but when I check the response body, it's blank.

After a while, Chrome raise the error Paused before potential out-of-memory crash in line 73 of file vendors.bundle.dll.js.

I then check the response body again, and it was present and contains only the 30 buckets of the aggregation (as expected). Datatable

I wanted to check if this problem was the same on other visualizations and the response is NO.

I tried the same aggregation (intervall 0.5) on a datatable, and it works perfectly. Line chart

To push the investigation further, I tried to reproduce the bug on a Line chart visualization, and there is the issue.

I did not tried on other. Conclusion

There is a difference between Datatable aggregation treatments and Bar chart (Line chart and maybe other) treatement.

This difference make kibana crash on Google Chrome and Firefox.

Would you like a dataset with an elastic mapping to reproduce the bug ?

— You are receiving this because you were assigned.

Reply to this email directly, view it on GitHub https://github.com/elastic/kibana/issues/36328?email_source=notifications&email_token=AADRH27QLD5FTH5JESFIBD3PZ5OHXA5CNFSM4HLW5NP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXMK5YA#issuecomment-500739808, or mute the thread https://github.com/notifications/unsubscribe-auth/AADRH24PR5WICTEGDBZPFH3PZ5OHXANCNFSM4HLW5NPQ .

GasparQ commented 5 years ago

I joined the dataset I used to this message. It's formatted in csv.

kibana_bug_dataset.txt

kertal commented 5 years ago

ok, I could reproduce it, thx for your detailed instructions + data

dtungbmw commented 4 years ago

my workaround is to mutiply x, y values 100 times and use interval = 1, then it works without hanging.

Screen Shot 2019-12-19 at 12 21 51 PM