allthingssecurity commented on PR #30702:
URL: https://github.com/apache/camel/pull/30702#issuecomment-7125442983
Thanks Claus. All points are in one new commit: 9f94495ce3.
1. The test race: in `pollOfSeveralDirectoriesDeletesTheDoneFileOfEach` the
`mock.reset()` and `expectedBodiesReceived("other")` now come before the three
`writeString` calls of the second part, so a quick poll cannot deliver `other`
before the expectation is set.
2. `lastOfEachDoneFile` now returns a `BitSet` of batch indexes, and the
loop checks the bit of the current index (the exchange's `BATCH_INDEX`). It
keeps a map from done file name to index while it scans, and no exchanges after
that, so a finished exchange is no longer reachable for the rest of the poll.
The result is the same as with the identity set.
`FileConsumerDoneFileNameRecursiveTest` passes unchanged apart from the reorder
in point 1.
3. I added a comment at the field and where `processExchange` hands
`lastOfDoneFile` to `GenericFileOnCompletion`: it relies on `processExchange`
being called from inside `processBatch`, on the poll thread.
4. Upgrade guide: the entry now sits right after the CAMEL-25728 "kept done
file" entry, the title names camel-mina-sftp, and it says that a file that
failed earlier in such a directory (and was not moved with `moveFailed`) now
waits for a new done file, as it already did in the directory of the last file
of the poll.
About #30700: the branch was already on top of main with #30700 in it (the
PR commit's parent is 5453fe8005, after the merge of #30700), so CI runs with
both changes. A merge-tree of the PR head with the current main (5776ae01d1) is
clean, and the main commits since then do not touch camel-file, camel-core or
the upgrade guide, so I did not add a merge commit.
Runs: camel-file 49 tests, the camel-core file tests
(`org.apache.camel.component.file.**`) 565 run, 12 skipped, camel-ftp 288 run,
9 skipped, camel-mina-sftp 53 run, 1 skipped, 0 failures. The done file ITs of
camel-ftp (`FtpConsumerDoneFileNameIT`, `FtpConsumerDualDoneFileNameIT`,
`FtpConsumerDoneFileNameFixedIT`, `FtpProducerDoneFileNameIT`,
`SftpConsumerMaxMessagesPerPollListingIT`, 20 tests) and
`MinaSftpConsumerMaxMessagesPerPollListingIT` (9) pass with the embedded
servers. The new test with `FileConsumerDoneFileNameAsyncLastFileTest`,
`FileConsumerDoneFileNameFilesLeftTest` and `FilerConsumerDoneFileNameTest` 20
times in one JVM: 340 run, 0 failures. Formatter and import sort pass.
--
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]