Skip to content

Footgun when retrieving multiple metrics from the same family #300

Description

@huntc

Another footgun that I discovered the hard way (production) is to get_or_create multiple metrics within a family and assign to multiple variables and then deadlock. It isn't apparent that a lock is held and returned. Perhaps renaming get_or_create to get_or_create_with_lock would be an improvement, or provide a closure to get_or_create.

This then keeps the scope of the lock to local.

I realise there is Rustdoc on this, but that's easy to be missed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions