Skip to content

Cleanup transfer manager #619

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

Merged
merged 3 commits into from
May 5, 2023

Conversation

douglas-raillard-arm
Copy link
Collaborator

@douglas-raillard-arm douglas-raillard-arm commented Feb 20, 2023

Cleanup and simplify transfer manager infrastructure to make it more reliable.

WARNING: Not tested on SSH connection yet.
Tested on android along #618

@mrkajetanp
Copy link
Contributor

With the above changes the PR makes the PerfettoCollector work fine without specifying an explicit pull timeout so looks like it works :)

@douglas-raillard-arm
Copy link
Collaborator Author

@mrkajetanp I updated the PR with your review, thanks for testing it

@mrkajetanp
Copy link
Contributor

We should be good to go then! I'll update the Collector PR to drop the timeout in that case

@douglas-raillard-arm
Copy link
Collaborator Author

PR updated with both typos fixed

@douglas-raillard-arm douglas-raillard-arm force-pushed the fix_xfer_mgr branch 2 times, most recently from a053d55 to 46f42fa Compare April 4, 2023 10:05
@douglas-raillard-arm
Copy link
Collaborator Author

PR updated:

  • TransferHandleBase defers the logger to its self.manager
  • transfer_mgr => transfer_manager
  • Fixed callback of SFTP transfer
  • Fixed time.monotonic() imports

Thanks a lot for the testing

@douglas-raillard-arm
Copy link
Collaborator Author

PR updated with:

  • fixed xfer percent formula for SFTP

Implement a sane interface avoiding variable positional arguments.
* Split TransferManager and TransferHandle:
    * TransferManager deals with the generic monitoring. To abort a
      transfer, it simply cancels the transfer and raises an exception
      from manage().
    * TransferHandle provides a way for the manager to query the state
      of the transfer and cancel it. It is backend-specific.

* Remove most of the state in TransferManager, along with the associated
  background command leak etc

* Use a daemonic monitor thread to behave as excpected on interpreter
  shutdown.

* Ensure a transfer manager _always_ exists. When no management is
  desired, a noop object is used. This avoids using a None sentinel,
  which is invariably mishandled by some code leading to crashes.

* Try to merge more paths in the code to uncover as many issues as
  possible in testing.

* Fix percentage for SSHTransferHandle (transferred / (remaining +
  transferred) instead of transferred / remaining)

* Rename total_timeout TransferManager parameter and attribute to
  total_transfer_timeout to match the connection name parameter.
@douglas-raillard-arm
Copy link
Collaborator Author

PR updated with s/mgr/manager, and rebased on master (there was a conflict so we might want to give it a last spin before merging)

@marcbonnici marcbonnici merged commit ddaa2f1 into ARM-software:master May 5, 2023
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.

3 participants