GithubHelp home page GithubHelp logo

Replace owning_ref about client_rust HOT 7 CLOSED

prometheus avatar prometheus commented on May 23, 2024 5
Replace owning_ref

from client_rust.

Comments (7)

AbhijithGanesh avatar AbhijithGanesh commented on May 23, 2024

True, this issue has popped up here in LibP2P and other crates which uses this prometheus client

from client_rust.

AbhijithGanesh avatar AbhijithGanesh commented on May 23, 2024

Can I work on patching the issue ? @mxinden

from client_rust.

AbhijithGanesh avatar AbhijithGanesh commented on May 23, 2024

The Owning_Ref library is used at the following files:

Histogram relevant files use this module, they cannot be used due to Security reasons! This needs to be patched where the usage of Owning_Ref is dropped!

from client_rust.

DieracDelta avatar DieracDelta commented on May 23, 2024

In other issues I see this being recommended. Haven't had a chance to look too deeply, but perhaps that is a suitable replacement?

from client_rust.

mxinden avatar mxinden commented on May 23, 2024

Can I work on patching the issue ? @mxinden

Yes, for sure. Help is very much appreciated.

In other issues I see this being recommended. Haven't had a chance to look too deeply, but perhaps that is a suitable replacement?

Can you tell whether it suffers the same unsoundness issues that owning_ref does?


We need owning_ref in wrapper style metrics (e.g. Family), which internally use a Mutex though want to give users access to a reference of the underlying wrapped metric (e.g. Counter). Given that this reference depends on the MutexGuard, we need to ensure that the MutexGuard lives long enough, i.e. throughout the lifetime of the reference of the wrapped metric. Without keeping the MutexGuard alive, we invalidate the properties of the Mutex itself, namely mutual exclusive access to the wrapped metric.

Thus far owning_ref offered a way to ship both the MutexGuard and the reference to the user, thus enforcing the lifetime bound.

Alternative approaches I can see:

  • Use parking_lot and its RwLockGuard::map method.
  • Take a FnOnce to access the wrapped metric, instead of returning a reference to the wrapped metric.
  • Clone the wrapped metric on each access.

from client_rust.

AbhijithGanesh avatar AbhijithGanesh commented on May 23, 2024

@mxinden I went through the solution parking_lot offers. I am unable to figure out how to deal with the MutexGuardedBuckets and that is preventing me from fixing the solution. What should I do next?

from client_rust.

mxinden avatar mxinden commented on May 23, 2024

For the record, fix is released with v0.18.0.

#80

from client_rust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.