Skip to content
This repository was archived by the owner on Dec 3, 2025. It is now read-only.
This repository was archived by the owner on Dec 3, 2025. It is now read-only.

Mitigation for nested lock (or deadlock) #7

@shsym

Description

@shsym

For a complicated data structure where Roy data structures are defined within another Roy.remote data structure, developers accidentally try to lock the inner lock inside the critical section (=while the outer class is already holding the hierarchical locks).

  • For this case, we can skip the locking/unlocking in __enter__ and __exit__, because a single instance of Roy data structure or class should be accessible by a single thread. In other words, each Ray worker has its own instance of the data structure.

Example:

- Class A
  - Class B
  • When the outer class is locked, say with Class A:, the inner class (Class B) is also locked automatically.
  • When a developer accidentally does with Class B: within with Class A:, if we can confidently detect this occurrence, we can skip locking/unlocking around with Class B: and going out of the context.

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