Skip to content
This repository was archived by the owner on Jan 15, 2026. It is now read-only.

Cleanup transfer manager - #619

Merged
marcbonnici merged 3 commits into
ARM-software:masterfrom
douglas-raillard-arm:fix_xfer_mgr
May 5, 2023
Merged

Cleanup transfer manager#619
marcbonnici merged 3 commits into
ARM-software:masterfrom
douglas-raillard-arm:fix_xfer_mgr

Conversation

@douglas-raillard-arm

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

Copy link
Copy Markdown
Collaborator

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

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

Comment threaddevlib/connection.py Outdated
Comment threaddevlib/utils/android.py Outdated
@mrkajetanp

Copy link
Copy Markdown
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
Copy Markdown
CollaboratorAuthor

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

@mrkajetanp

Copy link
Copy Markdown
Contributor

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

Comment threaddevlib/utils/ssh.py
Comment threaddevlib/utils/ssh.py Outdated
Comment threaddevlib/utils/ssh.py Outdated
@douglas-raillard-arm

Copy link
Copy Markdown
CollaboratorAuthor

PR updated with both typos fixed

Comment threaddevlib/utils/android.py Outdated
Comment threaddevlib/connection.py Outdated
Comment threaddevlib/connection.py
Comment threaddevlib/connection.py
Comment threaddevlib/connection.py
@douglas-raillard-arm
douglas-raillard-armforce-pushed the fix_xfer_mgr branch 2 times, most recently from a053d55 to 46f42faCompareApril 4, 2023 10:05
@douglas-raillard-arm

Copy link
Copy Markdown
CollaboratorAuthor

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
Copy Markdown
CollaboratorAuthor

PR updated with:

  • fixed xfer percent formula for SFTP

Comment threaddevlib/utils/android.py Outdated
* 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
Copy Markdown
CollaboratorAuthor

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:masterMay 5, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@douglas-raillard-arm@mrkajetanp@marcbonnici