Skip to content

Race condition under load #76

@mrzasa

Description

@mrzasa

We noticed that under load, mongoid locker allows more than one thread to enter a critical section. The issue can be reproduced using this repository that contains full description of the scenario.

During the investigation we removed mongoid-locker and mongoid and reproduced the issues. It means that the bug is not in the mongoid-locker itself. It breaks the mongoid-locker though. It's reported in mongo ruby driver tracker, I'm writing to make you aware of the issue.

I also provided a simpler lock implementation based on expiring and unique indices. It passes our test and cause no issues on production.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions