Skip to content
This repository has been archived by the owner on Jan 7, 2020. It is now read-only.

Fix segfault on unresponsive APIs #787

Merged
merged 1 commit into from
Jun 11, 2018
Merged

Fix segfault on unresponsive APIs #787

merged 1 commit into from
Jun 11, 2018

Conversation

amdprophet
Copy link
Member

Signed-off-by: Justin Kolberg amd.prophet@gmail.com

Description

Fixes a segfault when there are one or more unresponsive APIs.

Related Issue

Fixes #786.

Motivation and Context

Uchiwa should not be segfaulting.

How Has This Been Tested?

Tested locally by stopping the Sensu API. Uchiwa backend no longer segfaults and errors are appropriately displayed on the frontend.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Signed-off-by: Justin Kolberg <amd.prophet@gmail.com>
@@ -42,7 +42,7 @@ type DatacenterSnapshot struct {
Checks []interface{}
Clients []interface{}
Events []interface{}
Info structs.Info
Info *structs.Info

Choose a reason for hiding this comment

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

Why make this a pointer? Not saying it's wrong to have a pointer here, just curious about the reasoning.

Copy link
Member Author

Choose a reason for hiding this comment

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

I made it a pointer so that it can be assigned & checked for a nil value.

@amdprophet amdprophet merged commit bb23b40 into master Jun 11, 2018
@amdprophet amdprophet deleted the fix-crash branch June 11, 2018 17:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

uchiwa 1.3.0 segfaults on unreachable sensu host
2 participants