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

fix: pprof export incompatible period types #3198

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

kolesnikovae
Copy link
Collaborator

@kolesnikovae kolesnikovae commented Apr 11, 2024

Fixes #3197

The issue was that empty ValueType values (both period type and sample type) were used in the pprof response along the read path as they added after the profile merge. An empty ValueType references string with index 0, assuming that the value is "". However, in practice, we cannot guarantee that it's always true, which leads to period/sample type mismatches in rare cases.

This was necessary in the past because the original profile.Merge verified the compatibility of profiles. Now that we have our own specialized pprof merge, this is no longer needed. The fix ensures that empty ValueType is ignored during the merge. I believe this could be further simplified by removing the stubs entirely. Although a quick attempt revealed that this would require quite a few changes, I think it's best to implement this separately.

@kolesnikovae kolesnikovae marked this pull request as ready for review April 11, 2024 15:16
@kolesnikovae kolesnikovae requested a review from a team as a code owner April 11, 2024 15:16
@kolesnikovae
Copy link
Collaborator Author

kolesnikovae commented Apr 11, 2024

However, in practice, we cannot guarantee that it's always true, which leads to period/sample type mismatches in rare cases.

Which is another issue – we must guarantee that; #3199.

Copy link
Contributor

@simonswine simonswine left a comment

Choose a reason for hiding this comment

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

Thanks for digging down deep to fix this

LGTM

@kolesnikovae kolesnikovae merged commit ae6c110 into main Apr 12, 2024
16 checks passed
@kolesnikovae kolesnikovae deleted the fix/pprof-merge-empty-profile branch April 12, 2024 02:03
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.

pprof export: incompatible period types
2 participants