yashmayya commented on code in PR #12568:
URL: https://github.com/apache/kafka/pull/12568#discussion_r957548339
##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/standalone/StandaloneHerder.java:
##########
@@ -294,7 +294,12 @@ public synchronized void restartConnector(String connName,
Callback<Void> cb) {
worker.stopAndAwaitConnector(connName);
- startConnector(connName, (error, result) -> cb.onCompletion(error,
null));
+ startConnector(connName, (error, targetState) -> {
+ if (targetState == TargetState.STARTED) {
+ requestTaskReconfiguration(connName);
Review Comment:
I'm wondering if this should be submitted as a runnable to
`requestExecutorService` instead - since `restartConnector` is also called by
the `POST /{connector}/restart` API, and this change could lead to a
significantly higher response latency. Also, if we were to do that, should we
add a `sleep` call to the relevant unit tests and retain the same expectations
/ verifications (with the assumption that the requestExecutorService will
complete the task in the background)?
Edit: I guess a better option on the testing front might be to pass an
implementation of `ScheduledExecutorService` to `StandaloneHerder` which runs
tasks in the same thread.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]