Do not block when downloading more than 100 changes over SSH

[?]
Dec 4, 2020, 10:15 AM
WLUID7NANDWTN5GOECNEKFTLZF3MUVS7K26YWLYLSGJ56G63NV4QC

Dependencies

  • [2] QE64ATLZ Fixing asynchronicity problems in SSH
  • [3] Q45QHPO4 Feedback on network stuff
  • [4] I52XSRUH Massive cleanup, and simplification
  • [5] UDHP4ZVB Fixing SSH asynchronicity issues
  • [6] K6GWUOD5 Styling progress bars
  • [7] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [8] 367UBQ6K Forwarding SSH stderr, and progress bar for push

Change contents

  • replacement in pijul/src/remote/ssh.rs at line 411
    [4.5130][4.5130:5178]()
    *sender = None;
    [4.5130]
    [4.5178]
    std::mem::drop(sender.take());
  • edit in pijul/src/remote/ssh.rs at line 709
    [4.45564]
    [4.8856]
    self.download_changes_(c, Some(sender), changes_dir, full)
    .await
    }
    async fn download_changes_(
    &mut self,
    c: &[libpijul::pristine::Hash],
    mut sender: Option<&mut tokio::sync::mpsc::Sender<libpijul::pristine::Hash>>,
    changes_dir: &mut PathBuf,
    full: bool,
    ) -> Result<(), anyhow::Error> {
  • replacement in pijul/src/remote/ssh.rs at line 755
    [3.165][4.9854:9905](),[4.9854][4.9854:9905](),[4.9905][3.166:202](),[3.202][4.378:401](),[4.9905][4.378:401]()
    if sender.send(_hash).await.is_err() {
    progress.abandon();
    break;
    [3.165]
    [4.49729]
    if let Some(ref mut sender) = sender {
    if sender.send(_hash).await.is_err() {
    progress.abandon();
    break;
    }
  • replacement in pijul/src/remote/ssh.rs at line 825
    [2.421][4.52158:52222](),[4.52158][4.52158:52222](),[4.52222][2.422:501]()
    let (mut send, recv) = tokio::sync::mpsc::channel(100);
    self.download_changes(&hashes, &mut send, &mut repo.changes_dir, true)
    [2.421]
    [4.52289]
    self.download_changes_(&hashes, None, &mut repo.changes_dir, true)
  • edit in pijul/src/remote/ssh.rs at line 828
    [4.52411][4.52411:52441]()
    std::mem::drop(recv);