Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow stoppage of downloader to free up network #341

Merged
merged 7 commits into from
May 14, 2024
Merged

Conversation

de-sh
Copy link
Contributor

@de-sh de-sh commented May 2, 2024

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

  1. Start uplink
  2. Trigger a download action, wait for the download to start on the device
  3. Once the download has started, disable downloader with:
curl -X PUT http://localhost:3333/disable_downloader
  1. Observe if download continues or if the timeout is short enough, for the action to be timedout.
  2. After noticing that download is disabled as expected, enable downloader with:
curl -X PUT http://localhost:3333/enable_downloader
  1. 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

@de-sh de-sh marked this pull request as ready for review May 3, 2024 06:11
@de-sh de-sh requested a review from gautambt May 3, 2024 06:36
@de-sh de-sh merged commit 959550a into main May 14, 2024
2 checks passed
@de-sh de-sh deleted the stop-downlaod branch May 14, 2024 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant