Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,9 @@ public static void testFailureToFenceEpoch(
long producerId;
int initialProducerEpoch;

try (var producer1 = createTransactionalProducer(clusterInstance, "transactional-producer")) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about producer1.close(duration 5 secs) in finally ? This will force a hard close after the time out, instead of waiting for pending reqs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

How about producer1.close(duration 5 secs) in finally ? This will force a hard close after the time out, instead of waiting for pending reqs.

Thanks, that’s a fair point. I considered close(Duration.ofSeconds(5)) as well, but it changes the cleanup behavior to force-close after the timeout. The current approach keeps the try-with-resources close graceful, while bounding the pending requests with a shorter request timeout. Maybe we should decide which behavior is more appropriate for this test.

// Use a shorter request timeout to bound the graceful close delay when the fencing probe leaves producer1 in an empty transaction.
try (var producer1 = createTransactionalProducer(
clusterInstance, "transactional-producer", 60000, 60000, 120000, 1000)) {
producer1.initTransactions();

producer1.beginTransaction();
Expand Down
Loading