MINOR: Gracefully close the consumer in ConsumeBenchWorker#6033
MINOR: Gracefully close the consumer in ConsumeBenchWorker#6033stanislavkozlovski wants to merge 5 commits into
Conversation
| long curTimeMs = Time.SYSTEM.milliseconds(); | ||
| log.info("{} Consumed total number of messages={}, bytes={} in {} ms. status: {}", | ||
| clientId, messagesConsumed, bytesConsumed, curTimeMs - startTimeMs, statusData); | ||
| consumer.close(); |
There was a problem hiding this comment.
It seems like we'd want to close the consumer before completing doneFuture right? Given that, it seems like we should do it before calling abort and right after the finally. What do you think?
There was a problem hiding this comment.
Also, I suggest renaming abort to abortAndThrow.
There was a problem hiding this comment.
Agreed, we're not done until we close the consumer
|
Quick question: any thoughts on a test we could write for this? |
|
So, the thing to keep in mind here is that when the worker shuts itself down, its One thing I notice that could be fixed is that |
|
This PR is being marked as stale since it has not had any activity in 90 days. If you If you are having difficulty finding a reviewer, please reach out on the [mailing list](https://kafka.apache.org/contact). If this PR is no longer valid or desired, please feel free to close it. If no activity occurs in the next 30 days, it will be automatically closed. |
|
This PR has been closed since it has not had any activity in 120 days. If you feel like this |
Since WorkerUtils.abort propagates the exception after handling it, any exceptions raised will not close the consumer properly