Skip to content

Transfer requests are neither queued nor deduplicated — N identical downloads write N copies #50

Description

@jordlee

Environment: ILCE-7M5 (CFCA6014E092) · USB · Camera Remote SDK V2.02.00 · darwin-arm64 (macOS 15) · server 3.0.0 · remote-transfer

Summary

The server neither queues nor deduplicates RemoteTransfer requests. Two independent consequences:

  1. A request issued while another transfer is in flight is rejected outright with 0x8D03 rather than being queued. There is no way for a client to submit work and let the server sequence it, and no exposed "transfer in progress" state it could poll to avoid the collision.
  2. Repeated identical requests each create a new file rather than being coalesced or rejected.

Observed

Four successive POST .../131201/1/download calls for the same content_id/file_id, spaced 2/5/10/20 s apart, all returned 202 and all wrote separate copies:

DSC09991.JPG    = 10438049
DSC09991(1).JPG = 10438049
DSC09991(2).JPG = 10438049
DSC09991(3).JPG = 10438049

Same bytes, four times, ~40 MB of duplicate I/O over USB for one logical request.

Why it bites

A client that cannot tell whether its 202 will complete — see #44, where a transfer can be dropped with no terminal event — has an obvious and reasonable strategy: retry. Doing so silently multiplies files on disk and transfer time on the wire, and each retry that lands while the previous attempt is still running is rejected with a message that reads as a hard failure (filed separately).

Suggested

  • Serialize transfers in a queue, so a request submitted during an in-flight transfer is accepted and run in turn rather than rejected.
  • Coalesce or reject an identical in-flight (cameraId, contentId, fileId, savePath) rather than starting a second copy.
  • Expose the in-flight transfer (and any queue depth) so clients can make informed decisions instead of guessing.

Found while running the cross-platform transfer sweep in #40.

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions