Skip to content

Implement async progress reporting for upload / assembly #214

Closed

Description

@butonic

When finishing a large upload the assembly of a 40 GB file might take a long time. Currently, tus has no extension for this and the concatenation extension explicitly states:

The response to a HEAD request for a final upload SHOULD NOT contain the Upload-Offset header unless the concatenation has been successfully finished. After successful concatenation, the Upload-Offset and Upload-Length MUST be set and their values MUST be equal. The value of the Upload-Offset header before concatenation is not defined for a final upload.

transloadit is mentioning the /assembly endpoint https://github.com/tus/tusd/wiki/Uploading-to-Transloadit-using-tus and also that it uses a socket.io server that can be used to track the progress: https://github.com/tus/tusd/wiki/Uploading-to-Transloadit-using-tus#getting-progress-and-more-events-over-web-sockets

The tusd handler has a hook mechanism that can be used to expose progress.

Or we could let clients make HEAD requests against the upload and return a read only progress property in the metadata ... as a quick hack ...

Activity

  1. butonic commented on Apr 21, 2020

    @butonic
    ContributorAuthor

    thx @michaelstingl for asking about this

  2. butonic commented on Apr 22, 2020

    @butonic
    ContributorAuthor

    @felixboehm I wonder if we can use websockets for clients and how this integrates with a push server ... maybe related appleboy/gorush#194

  3. michaelstingl commented on Apr 22, 2020

    @michaelstingl
    Contributor

    I think as a fallback, we'll always need pull/polling-based approach. But it would be cool to have the more fancy options too.

  4. butonic commented on May 19, 2020

    @butonic
    ContributorAuthor

    AFAICT an upload has multiple phases:

    • transfer (bring bytes to the storage, but not yet accessible to the user)
    • assembly (optional, if multiple chunks need to be assembled)
    • preprocessing (optional, eg virus scanning, content manipulation)
    • finishing (make available to the user)
    • postprocessing (content indexing, thumbnail generation ...)

    The tus protocol only covers the first and second phase, transfer and assembly.

    When no preprocessing happens, we can return the etag and new fileid immediately.
    While preprocessing is in progress we want to show the progress when listing the containing folder. This might be a custom PROPFIND request or property? during progress the etag and fileid won't hale changed, but we might return a progress property? Similar to the async / lazy ops header, which returns a location that clients can use to poll for changes.

    AFAICT we need to either extend the FinishUpload method of the tus backend implementations or register hooks that can start the preprocessing properly, keep track of progress and finalize the upload by making the file available to the user / moving it to the correct destination.

    postrocessing should not produce anything the clients need.

    But for all of this we need a workflow. AFAICT the client may not get a new etag until the upload has passed the finishing phase.

  5. PVince81 commented on May 19, 2020

    @PVince81
    Contributor

    as discussed, we'd need to invent a new TUS extension for async.
    the extension would return extra headers to signal that it's going into async mode (like Lazy-Ops)

  6. refs commented on Jan 12, 2021

    @refs
    Contributor

    @butonic want to keep this open?

  7. changed the title [-]implement async progress reporting for upload / assembly[/-] [+]Implement async progress reporting for upload / assembly[/+] on Jan 13, 2021
  8. added
    Category:Research
    Interaction:Needs-help
    on Jan 13, 2021
  9. butonic commented on Mar 8, 2021

    @butonic
    ContributorAuthor

    cc @dragotin This boils down to a state machine for uploads. Then file listings could return the state of a file as well: transfer, assembly, preprocessing, finishing, postprocessing. See #214 (comment)

  10. stale commented on Jun 6, 2021

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

  11. fschade commented on Jun 4, 2024

    @fschade
    Contributor

    Please open again if the ticket is still relevant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Category:ResearchInteraction:Needs-ConceptInteraction:Needs-help

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions