Skip to content

fix: check for non-nil Locality before use in group_processes#50

Merged
singler merged 1 commit intomainfrom
hk/locality
Apr 2, 2025
Merged

fix: check for non-nil Locality before use in group_processes#50
singler merged 1 commit intomainfrom
hk/locality

Conversation

@singler
Copy link
Copy Markdown
Contributor

@singler singler commented Apr 2, 2025

Locality could be nil in some cases and cause a panic

tags["zone"] = process.Locality.ZoneId
if process.Locality != nil {
tags["zone"] = process.Locality.ZoneId
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Shall we maybe set "zone" tag to "unknown" in case Locality info is missing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure what would be better in this case. In other codepath we're setting zone only if locality is available, so to have parity with that behavior just not setting it seems to be better

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes, we should set to unknown, otherwise tally will crash if there are time series with different tags.

@singler singler merged commit aee8252 into main Apr 2, 2025
1 check passed
@singler singler deleted the hk/locality branch April 2, 2025 12:31
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.

3 participants