Skip to content
This repository was archived by the owner on Feb 20, 2024. It is now read-only.
This repository was archived by the owner on Feb 20, 2024. It is now read-only.

Asynchronous callbacks ridiculously hard to use #13

@bbockelm

Description

@bbockelm

It appears that it's incredibly difficult to use the asynchronous callback mechanism due to lock ordering issues:

  • The callback thread pool holds various Xrootd locks when it invokes python, which needs the python GIL.
  • Python-owned threads have the python GIL and needs various Xrootd locks when invoking operations in the Xrootd module.

Hence, it's quite straightforward to deadlock.

In order to actually use the asynchronous callbacks, you must be able to guarantee there is no call to the Xrootd module from any python threads as long as there are pending callbacks. It's a pretty high barrier.

Would it be possible to invoke callbacks from a separate thread pool which takes the python GIL first?

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