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

Issue #126 - Gracefully fail when database connection can't be made for playback #127

Merged
merged 2 commits into from
Aug 29, 2019

Conversation

MJJoyce
Copy link
Member

@MJJoyce MJJoyce commented Aug 20, 2019

Update the server endpoints and Playback component so they fail gracefully when a database connection cannot be made.

Resolve #126

Update the server endpoints and Playback class so a failed database
connection doesn't prevent the GUI Plugin from functioning / booting
normally. The Playback class tracks whether playback is "enabled" and
the server endpoints use this status flag to determine how best to
respond to requests.
Update the Playback component to display a warning banner if no valid
time ranges were returned from the backend. This can either be because
there's no valid time ranges of data in the database or (more likely)
because the database connection isn't configured or failed.
@@ -127,21 +127,31 @@ class Playback(object):
A Playback manages the state for the playback component.
playback.dbconn: connection to database
playback.query: time query map of {timestamp: list of (uid, data)} from database
playback.on: true if gui is currently in playback mode
playback.on: True if gui is currently in playback mode. Real-time telemetry will not
be sent to the frontend during this.
Copy link
Contributor

@aywaldron aywaldron Aug 22, 2019

Choose a reason for hiding this comment

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

Just curious, is stopping real-time telem during playback the intended functionality, or something to change in the future?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's intended. If we're playing back telemetry from a historical query we cut off the real time stream to the clients so the older data can be replayed.

@aywaldron
Copy link
Contributor

When I test this without a database connection nothing shows up under the playback tab, should we add a statement saying playback is disabled?

@MJJoyce
Copy link
Member Author

MJJoyce commented Aug 23, 2019

@aywaldron, did you build the static files? At the moment they're out of date in this PR so you won't see it by default. I planned to update master after we merge so we can be up-to-date with stuff.

@aywaldron
Copy link
Contributor

@MJJoyce Ok that explains it, since I saw the statement in the code. Sounds good then.

@MJJoyce MJJoyce merged commit ab613c5 into master Aug 29, 2019
@aywaldron aywaldron deleted the issue-126 branch September 9, 2019 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Telemetry Playback component and server endpoints should fail gracefully
2 participants