Skip to content

Conversation

Sploder12
Copy link
Contributor

Fixes the issue of multipass transfer only transferring some chunks of the file. This uses sftp_limits instead of the constant 65536u to determine the correct buffer size for SFTP reads and writes.

Fixes #3892
MULTI-1768

Copy link

codecov bot commented Jan 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.11%. Comparing base (620770e) to head (3d9d0e6).
Report is 35 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3902      +/-   ##
==========================================
- Coverage   89.11%   89.11%   -0.01%     
==========================================
  Files         255      255              
  Lines       14600    14602       +2     
==========================================
+ Hits        13011    13012       +1     
- Misses       1589     1590       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

levkropp
levkropp previously approved these changes Jan 29, 2025
Copy link
Contributor

@levkropp levkropp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good on my end! Tested with the ingredients.tar.gz in the linked issue and they had the same md5sum after transferring

Copy link
Collaborator

@ricab ricab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Sploder12, good work. A couple of matters for discussion inline.

Copy link
Collaborator

@ricab ricab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, this looks good to me.

I tried transfers with different files, with random data, and they all worked. Unfortunately that's not worth much, because the same is true on the edge channel (i.e. I could not reproduce the original issue). Two other devs have verified the fix though, and the new code makes sense, so approving.

@@ -77,10 +77,19 @@ struct SFTPClient : public testing::Test
return {std::make_unique<mp::SSHSession>("b", 43, "ubuntu", key_provider)};
}

// this is a macro since REPLACE only applies to the current scope and cannot be moved out.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh you need the capture so extracting the lambda wouldn't work. You'd need std::bind or another lambda again. Alright.

@ricab ricab added this pull request to the merge queue Feb 7, 2025
Merged via the queue into main with commit b97e0b4 Feb 7, 2025
14 checks passed
@ricab ricab deleted the fix-transfer-partial-transfer branch February 7, 2025 14:35
@ricab ricab added this to the 1.16.0 milestone Jun 13, 2025
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.

multipass transfer only transfers half the file (every 2nd 32K block)
3 participants