Skip to content

Deadlock when calling upload again from the success callback (FileSystemManager) #35

@tristandl

Description

@tristandl

We're running into a strange issue using the file upload service. We need to upload 2 files, and mapped the success callback into a completion handling closure. We tried uploading the 2nd file from this handler and we get a deadlock and no file is uploaded. We're using a BLE transport.

We've reviewed the code in this library and can't really see a cause for it, and the solution we have is to dispatch the second call on a background queue. However, it seems like this should be supported because:

  • the first file is uploaded on the main thread
  • the upload takes places on a worker thread
  • the callback is called on the main thread
  • the second file is therefore also called on main thread (and from reviewing the code here, the locks are all released by the time the callback is called)

I can provide examples and references if this isn't sufficient to understand or recreate the situation, but I'm mostly concerned that we're doing something else wrong and this async dispatch is just sweeping things under the carpet.

Any thoughts/help appreciated, thank you. And great work on the library, it looks really solid!

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