uplink
uplink copied to clipboard
feat: allow stoppage of downloader to free up network
Closes #
Changes
Why?
There might be a requirement in the system to disable the downloader in order to prefer other network access events on the system that might otherwise be hindered by large downloads.
Trials Performed
- Start uplink
- Trigger a download action, wait for the download to start on the device
- Once the download has started, disable downloader with:
curl -X PUT http://localhost:3333/disable_downloader
- Observe if download continues or if the timeout is short enough, for the action to be timedout.
- After noticing that download is disabled as expected, enable downloader with:
curl -X PUT http://localhost:3333/enable_downloader
- Wait for the download to complete as expected.
Observations:
2024-05-03T06:10:17.367319Z TRACE uplink::collector::downloader: Downloading: size = 2 GiB, percentage = 3, elapsed = 13s
2024-05-03T06:10:17.371487Z TRACE uplink::collector::downloader: Downloading: size = 2 GiB, percentage = 3, elapsed = 13s
2024-05-03T06:10:17.371670Z TRACE uplink::collector::downloader: Downloading: size = 2 GiB, percentage = 3, elapsed = 13s
2024-05-03T06:10:17.371776Z TRACE uplink::collector::downloader: Downloading: size = 2 GiB, percentage = 3, elapsed = 13s
2024-05-03T06:10:17.371832Z INFO uplink::console: Downloader stopped
2024-05-03T06:10:17.379613Z TRACE uplink::collector::downloader: Downloading: size = 2 GiB, percentage = 3, elapsed = 13s
2024-05-03T06:10:24.744384Z INFO uplink::base::bridge::streams: action_status: points = 1 batches = 1 latency = 269
2024-05-03T06:10:24.745014Z DEBUG uplink::base::mqtt: Outgoing = Publish(86)
2024-05-03T06:10:24.754630Z TRACE uplink::collector::device_shadow: Ping took 10.973ms
2024-05-03T06:10:24.754845Z TRACE uplink::base::bridge::streams: Initialized stream buffer for device_shadow
2024-05-03T06:10:24.809573Z DEBUG uplink::base::mqtt: Incoming = PubAck(PubAck { pkid: 86 })
2024-05-03T06:10:24.914543Z DEBUG uplink::base::mqtt: Outgoing = PingReq
2024-05-03T06:10:24.968893Z DEBUG uplink::base::mqtt: Incoming = PingResp
2024-05-03T06:10:24.968965Z INFO uplink::base::mqtt: connected: publishes = 13 pubacks = 13 pingreqs = 1 pingresps = 1 inflight = 0
2024-05-03T06:10:24.969574Z DEBUG uplink::base::mqtt: Outgoing = Publish(87)
2024-05-03T06:10:25.020009Z DEBUG uplink::base::mqtt: Incoming = PubAck(PubAck { pkid: 87 })
2024-05-03T06:10:26.566884Z INFO uplink::console: Downloader started
2024-05-03T06:10:27.393013Z TRACE uplink::collector::downloader: Downloading: size = 2 GiB, percentage = 3, elapsed = 23s
2024-05-03T06:10:27.393574Z TRACE uplink::collector::downloader: Downloading: size = 2 GiB, percentage = 3, elapsed = 23s
2024-05-03T06:10:27.393873Z TRACE uplink::collector::downloader: Downloading: size = 2 GiB, percentage = 3, elapsed = 23s
2024-05-03T06:10:27.394200Z TRACE uplink::collector::downloader: Downloading: size = 2 GiB, percentage = 3, elapsed = 23s
2024-05-03T06:10:27.394501Z TRACE uplink::collector::downloader: Downloading: size = 2 GiB, percentage = 3, elapsed = 23s