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

Remove histogram::Histogram from public API #935

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

muzarski
Copy link
Contributor

Ref: #771

Motivation

histogram is an unstable crate and the types introduced by this crate need to be removed from our public API. The only type being used is histogram::Histogram.

It's exposed publicly via MetricsError::Poison. However, the MetricsError::Poison value is never constructed since we always unwrap the PoisonError when trying to acquire the lock.

Changes

Removed MetricsError::Poison and refactored MetricsError to be a struct holding an error cause (&'static str returned from the histogram::Histogram API).

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • I added relevant tests for new features and bug fixes.
  • All commits compile, pass static checks and pass test.
  • PR description sums up the changes and reasons why they should be introduced.
  • I have provided docstrings for the public items that I want to introduce.
  • I have adjusted the documentation in ./docs/source/.
  • I added appropriate Fixes: annotations to PR description.

Public MetricsError enum contains a reference to `Histogram`.

In fact, the `MetricsError::Poison` is never really constructed
since we always unwrap the PoisonError when trying to acquire
the mutex.

This is why we get rid of the `MetricsError::Poison` enum value and
convert the `MetricsError` enum to struct holding an error cause.
@muzarski muzarski requested a review from piodul February 15, 2024 15:28
@piodul
Copy link
Collaborator

piodul commented Feb 16, 2024

Curious, this was quite an obvious breaking change (removal of an enum variant in a public struct) but the semver checks job didn't report anything.

@piodul
Copy link
Collaborator

piodul commented Feb 16, 2024

Something went wrong when running the check:

image

Not sure what went wrong, but the CI job with the semver check should fail and not pass. I'll create an issue about that.

In any case, this is not a blocker for merge.

@piodul piodul added the API-breaking This might introduce incompatible API changes label Feb 16, 2024
@piodul piodul merged commit 77d0089 into scylladb:main Feb 16, 2024
11 checks passed
@Lorak-mmk Lorak-mmk mentioned this pull request May 9, 2024
@muzarski muzarski deleted the remove_public_usages_of_histogram branch October 29, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API-breaking This might introduce incompatible API changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants