Skip to content
Closed
Show file tree
Hide file tree
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 @@ -1322,10 +1322,9 @@ private void buildProducerAndAddTopic(Topic topic, long producerId, String produ
remoteAddress, topicName, producerId, ex.getMessage());

producer.closeNow(true);
if (producerFuture.completeExceptionally(ex)) {
commandSender.sendErrorResponse(requestId,
BrokerServiceException.getClientErrorCode(ex), ex.getMessage());
}
producerFuture.completeExceptionally(ex);
commandSender.sendErrorResponse(requestId,
BrokerServiceException.getClientErrorCode(ex), ex.getMessage());
return null;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,11 @@ public void testCreateProducerTimeoutThenCreateSameNamedProducerShouldFail() thr
producerName, Collections.emptyMap(), false);
channel.writeInbound(createProducer3);

// 1nd producer will fail
response = getResponse();
assertEquals(response.getClass(), CommandError.class);
assertEquals(((CommandError) response).getRequestId(), 1);

// 3nd producer will fail
response = getResponse();
assertEquals(response.getClass(), CommandError.class);
Expand Down