Skip to content

Race condition in shutdown #2239

@ocelotl

Description

@ocelotl

This check doesn't guarantee it only executes once. You could use the Once class to make it safe, but then you'll still have the same race on L118. You could modify Once to allow passing in a lock object (similar to how threading.Condition accepts an optional Lock object) and reuse it on L118 or inline the logic in Once here to make this all thread safe.

We actually have the same bug in the tracing SDK.

Feel free to open an issue for this and address in a separate PR

Originally posted by @aabmass in #2227 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    metricssdkAffects the SDK package.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions