I found an issue where InsertCollectionOperation fails to trigger session eviction when an AllNodesFailedException occurs.
The issue stems from how exceptions are propagated between the Operation and the CommandProcessor.
Expected or other operations behavior: In CommandProcessor, the handleProcessingFailure method is invoked after an operation. It is designed to verify the exception type and specifically evict the session if an AllNodesFailedException is encountered.
Current insert operation behavior: In InsertCollectionOperation, both insertOrdered and insertUnordered implementations use .transform((id, t) -> insertion.maybeAddFailure(t). This logic captures exceptions to support partial failures during batch insertions by storing the error within the insertion result object.
Because the exception is caught and transformed into a result object within the operation, it does not bubble up to the CommandProcessor. Consequently, handleProcessingFailure is never triggered for these exceptions, and the session remains active despite the node failure.