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

[Infra UI] Fix live tailing with the graphql api #22008

Merged

Conversation

weltenwort
Copy link
Member

@weltenwort weltenwort commented Aug 15, 2018

Rename slice target to logPosition

The slice name target was seriously lacking in the desciptiveness department so I renamed it to logPosition. It contains the desired log position (as selected by the datepicker) as well as the reported log position. The polling state for "live streaming" (see below) is also managed by this slice.

Live streaming

This changes the live streaming functionality to poll the log entry and summary graphql endpoints. It is started and stopped using the startAutoReload and stopAutoReload action creators of the logPosition slice. These are used by the streaming toggle button besides the date picker to toggle a 5s polling interval:

idle
image

streaming
image

While streaming is enabled, the log text jumps to the bottom and a loading indicator is displayed, which contains the time since the last polling cycle to indicate the age of the currently displayed data.

image

@weltenwort weltenwort added WIP Work in progress :Ingest UI Feature:Metrics UI Metrics UI feature labels Aug 15, 2018
@weltenwort weltenwort self-assigned this Aug 15, 2018
@weltenwort weltenwort added the loe:medium Medium Level of Effort label Aug 15, 2018
@elasticmachine
Copy link
Contributor

💔 Build Failed

@weltenwort weltenwort force-pushed the infra-ui-fix-live-tailing branch 2 times, most recently from c3ca6d5 to 98b6797 Compare August 16, 2018 14:00
@elasticmachine
Copy link
Contributor

💔 Build Failed

@weltenwort weltenwort force-pushed the infra-ui-fix-live-tailing branch from 98b6797 to 448573b Compare August 16, 2018 17:03
@elasticmachine
Copy link
Contributor

💔 Build Failed

@weltenwort weltenwort changed the title [Infra UI] [WIP] Fix live tailing with the graphql api [Infra UI] [needs rebase] Fix live tailing with the graphql api Aug 20, 2018
@weltenwort weltenwort added review and removed WIP Work in progress labels Aug 20, 2018
@weltenwort weltenwort requested a review from skh August 20, 2018 17:43
@weltenwort
Copy link
Member Author

jenkins, test this

@elasticmachine
Copy link
Contributor

💔 Build Failed

@weltenwort weltenwort force-pushed the infra-ui-fix-live-tailing branch from 448573b to ee8b70d Compare August 21, 2018 10:57
@weltenwort weltenwort changed the title [Infra UI] [needs rebase] Fix live tailing with the graphql api [Infra UI] Fix live tailing with the graphql api Aug 21, 2018
@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Contributor

@skh skh left a comment

Choose a reason for hiding this comment

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

I tested this by starting, stopping, and restarting live streaming on several logs. I could trigger Maximum call stack size exceeded errors but not consistently.

Stack traces from the console:

image

and from the error page:

Uncaught RangeError: Maximum call stack size exceeded (:1)
Version: 7.0.0-alpha1
Build: 9007199254740991
Error: Uncaught RangeError: Maximum call stack size exceeded (:1)
    at window.onerror (http://localhost:5601/bundles/commons.bundle.js:199111:32)
    at Object.invokeGuardedCallbackDev (http://localhost:5601/bundles/commons.bundle.js:211853:16)
    at Object.invokeGuardedCallback (http://localhost:5601/bundles/commons.bundle.js:211902:29)
    at Object.invokeGuardedCallbackAndCatchFirstError (http://localhost:5601/bundles/commons.bundle.js:211916:43)
    at executeDispatch (http://localhost:5601/bundles/commons.bundle.js:212181:19)
    at executeDispatchesInOrder (http://localhost:5601/bundles/commons.bundle.js:212203:5)
    at executeDispatchesAndRelease (http://localhost:5601/bundles/commons.bundle.js:212301:5)
    at executeDispatchesAndReleaseTopLevel (http://localhost:5601/bundles/commons.bundle.js:212312:10)
    at forEachAccumulated (http://localhost:5601/bundles/commons.bundle.js:212282:8)
    at runEventsInBatch (http://localhost:5601/bundles/commons.bundle.js:212443:5)
    at runExtractedEventsInBatch (http://localhost:5601/bundles/commons.bundle.js:212452:3)
    at handleTopLevel (http://localhost:5601/bundles/commons.bundle.js:215916:5)
    at batchedUpdates (http://localhost:5601/bundles/commons.bundle.js:224252:14)
    at batchedUpdates (http://localhost:5601/bundles/commons.bundle.js:213654:12)
    at dispatchEvent (http://localhost:5601/bundles/commons.bundle.js:215997:5)
    at interactiveUpdates (http://localhost:5601/bundles/commons.bundle.js:224307:14)

Uncaught RangeError: Maximum call stack size exceeded (http://localhost:5601/bundles/commons.bundle.js:211955)
Version: 7.0.0-alpha1
Build: 9007199254740991
Error: Uncaught RangeError: Maximum call stack size exceeded (http://localhost:5601/bundles/commons.bundle.js:211955)
    at window.onerror (http://localhost:5601/bundles/commons.bundle.js:199111:32)

I was looking at the logs from demo-stack-apache-01 when this happened but can't immediately reproduce.


I also saw those in the browser console, but also not consistently:

warning.js:33 Warning: This synthetic event is reused for performance reasons. If you're seeing this, you're accessing the method `relatedTarget` on a released/nullified synthetic event. This is a no-op function. If you must keep the original synthetic event around, use event.persist(). See https://fb.me/react-event-pooling for more information.

(They appeared for several (all?) properties on the synthetic event, I only pasted one above.)


Are these known problems?

@weltenwort
Copy link
Member Author

I came across that too, but it only happened to me with the redux devtools extension active. Something about the way it hooks into the store causes things to go wrong. Does the problem occur for you without the devtools active?

@skh
Copy link
Contributor

skh commented Aug 21, 2018

No, I couldn't reproduce without redux devtools active either.

Due to the way it was passed to `onClick`, the `stopAutoReload`
action creator was passed a React synthetic event. This lead to problems
in the redux-devtools-extension, which could not deal with that kind of
payload.
@weltenwort
Copy link
Member Author

@skh I found the reason for the devtools problem and fixed it (an accidental event object passed to the stopAutoReload action creator). Thanks for bringing it up again 👍

@elasticmachine
Copy link
Contributor

💔 Build Failed

@skh
Copy link
Contributor

skh commented Aug 22, 2018

Looks good, I can't reproduce the error anymore!

@weltenwort weltenwort merged commit 3b8d059 into elastic:feature-infra-ui Aug 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Metrics UI Metrics UI feature loe:medium Medium Level of Effort review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants