vamossagar12 commented on PR #13801: URL: https://github.com/apache/kafka/pull/13801#issuecomment-2049281246
@C0urante , I think I figured out the reason for the failure with `testFlushFailureWhenWritesToPrimaryStoreFailsAndSecondarySucceedsForTombstoneRecords`. The problem was that from we were returning the callback created [here](https://github.com/apache/kafka/blob/f895ab5145077c5efa10a4a898628d901b01e2c2/connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaOffsetBackingStore.java#L302) but when there is no write error to the secondary store, the [exception](https://github.com/apache/kafka/blob/f895ab5145077c5efa10a4a898628d901b01e2c2/connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaOffsetBackingStore.java#L348) object is null because of which [get](https://github.com/apache/kafka/blob/f895ab5145077c5efa10a4a898628d901b01e2c2/connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaOffsetBackingStore.java#L402) doesn't return an error. The primary store write error works fine but that's not the future the caller is waiting on. I have fixed this by creating a new `FutureCallback` object andmaking that as the underlying callback for `SetCallbackFuture`. The important thing is that it overrides the `get()` methods so that the caller of the method, waits on this future and now I can control throwing an exception when the primary store write fails and secondary store passes. Let me know what do you think about this. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org