ammachado commented on PR #30536:
URL: https://github.com/apache/camel/pull/30536#issuecomment-7071950410

   @davsclaus thanks for the careful trace. Addressed in the latest commit:
   
   **1. Unbounded autoCreate cache.** `builtDirectories` is now 
`Collections.newSetFromMap(LRUCacheFactory.newLRUCache(100))` in both 
`FtpOperations` and `SftpOperations`. A successful upload refreshes its 
directory, so the 100 most recently used directories are kept. 
`autoCreateRemembersOnlyTheMostRecentDirectories` in both ITs uploads into 101 
directories and checks that the first one is checked again while the last one 
is not. The upgrade guide mentions the bound.
   
   **2. Nested `deleteFile` during an FTP upload.** `deleteFile`, 
`retrieveFile` and the upload now save and restore `inStepwiseOperation` 
instead of resetting it to `false`. A `deleteFile` called while an upload or 
download runs keeps the behavior from before this PR: with stepwise, it changes 
in relative to the current directory (the directory of the file) and back, so 
the connection stays where the outer `STOR` needs it. 
`deleteFromAMoveExistingStrategyKeepsTheUploadInTheDirectoryOfTheFile` uses a 
custom strategy that deletes through the operations and then renames, as 
`SftpDefaultMoveExistingFileStrategy` does. Without the fix, the existing file 
is not moved and the new file is not stored in `p1/out`.
   
   **3. StreamCache bodies.** `FtpUtils.isBodyReadableAgain` now accepts a 
`StreamCache`, and both retry paths call `reset()` before the second attempt. 
`streamCacheBodyIsUploadedAgainIntoARemovedDirectory` covers FTP and SFTP. One 
caveat: in both tests the first attempt fails before the body is read (at `CWD` 
for FTP, at `OPEN` for SFTP), so the `reset()` itself is defensive and not 
exercised by a test.
   
   **4. NOOP skip.** Yes, it is meant to ship here. It is the other half of the 
per-upload round trips that the JIRA describes, it is documented in the upgrade 
guide, and the health check and the consumer still send their `NOOP`. Happy to 
split it out if you'd prefer to review it separately.
   
   **Nit.** `SftpStepwiseRequestsIT` now uses 
`MockEndpoint.assertIsSatisfied(context)`.
   
   _Claude Code on behalf of Adriano Machado (@ammachado)_
   
   _This was generated by an AI agent and may contain inaccuracies. Please 
verify before relying on it._
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to