-
Notifications
You must be signed in to change notification settings - Fork 82
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
*: Move to parking_lot
and thus make owning_ref
obsolete
#78
Conversation
Before `proemtheus-client` would use the `owning_ref` crate to map the target of a `std::sync::RwLockReadGuard`. `owning_ref` has multiple unsoundness issues, see https://rustsec.org/advisories/RUSTSEC-2022-0040.html. Instead of replacing `owning_ref` with a similar crate, we switch to locking via `parking_lot` which supports the above mapping natively. Signed-off-by: Max Inden <[email protected]>
I wonder whether moving to Gathering the WASM experts here. Do you have any opinions on this? Do we need to pipe through any feature flags? |
For the record, this patch does not seem to have a significant impact on benchmarks:
That said, I don't think the benchmarks are at a point, where I would say that they represent real world use-cases. |
Not sure if I'd consider myself a WASM expert 🙈 Do we currently support compiling to WASM? Looking through the CI config, it doesn't seem to be or at least it is not verified? Adding |
If WASM support is something we want to guarantee, I think we should make a separate PR that adds the target in the CI cross-compile config, merge that first and see if this PR is affected by it. |
@mxinden and @thomaseizinger , I am a new contributor to this project, I am interested in knowing why we should or shouldn't support WASM ? Why WASM for a client that exports metrics? I am not able to understand the usage of WASM here, can you explain! |
WASM is becoming a more and more relevant deployment target and no longer necessarily means "browser" or "web". See for example: It is completely feasible that users would want to collect metrics in applications written for either of these two platforms in which case they have to compile the Rust client for prometheus to WASM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Note: It looks like parking_lot actually has WASM support. When compiled without (experimental) WASM-atomic support, it just panics when trying to park, but that's fine. |
I've made a PR for that here: #79 |
Adding to this:
https://github.com/Amanieu/parking_lot#nightly-vs-stable |
Unless there are any objections, I will merge and release this tomorrow or next week. Thanks for the input everyone! |
…eus#78) Before `proemtheus-client` would use the `owning_ref` crate to map the target of a `std::sync::RwLockReadGuard`. `owning_ref` has multiple unsoundness issues, see https://rustsec.org/advisories/RUSTSEC-2022-0040.html. Instead of replacing `owning_ref` with a similar crate, we switch to locking via `parking_lot` which supports the above mapping natively. Signed-off-by: Max Inden <[email protected]>
Before
proemtheus-client
would use theowning_ref
crate to map the targetof a
std::sync::RwLockReadGuard
.owning_ref
has multiple unsoundnessissues, see https://rustsec.org/advisories/RUSTSEC-2022-0040.html. Instead of
replacing
owning_ref
with a similar crate, we switch to locking viaparking_lot
which supports the above mapping natively.Fixes #77