Skip to content

Impossible to interrupt a long-running media item upload if invoked via blocking method #43

@ylexus

Description

@ylexus

As per #30 (comment), I can confirm that interrupting the upload via interrupting the thread blocked on
client.uploadMediaItemCallable().futureCall(uploadRequest).get()
works.
However, as before, both
client.uploadMediaItem()
and
client.uploadMediaItemCallable().call(uploadRequest)
block uninterruptibly,
because ApiExceptions.callAndTranslateApiException calls Futures.getUnchecked(future), which blocks uninterruptibly by design.

I don't know in which situation one would ever want to block uninterruptibly to be honest. It's a road to unresponsive apps, leaking threads etc. Also, the behaviour should be symmetrical regardless of how you invoke the API. At the very least, the interrupt behaviour must be documented.

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