You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/07/26 22:55:23 UTC

[GitHub] [kafka] kkonstantine commented on a change in pull request #11132: KAFKA-13139: Empty response after requesting to restart a connector without the tasks results in NPE

kkonstantine commented on a change in pull request #11132:
URL: https://github.com/apache/kafka/pull/11132#discussion_r676997082



##########
File path: connect/runtime/src/main/java/org/apache/kafka/connect/runtime/rest/resources/ConnectorsResource.java
##########
@@ -269,7 +269,7 @@ public Response restartConnector(final @PathParam("connector") String connector,
             FutureCallback<Void> cb = new FutureCallback<>();
             herder.restartConnector(connector, cb);
             completeOrForwardRequest(cb, forwardingPath, "POST", headers, null, forward);
-            return Response.ok().build();
+            return Response.noContent().build();

Review comment:
       Thanks for the review @rhauch. I had the same questions and concerns. 
   
   Actually, the current behavior for both connector and task restarts is to return `HTTP/1.1 204 No Content`. So this fix should retain this behavior for the connector restart. 
   
   This seemed the most appropriate thing to do for a POST request who's response would have an empty body given the description in the RFC:
   https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5
   
   I also think that an addendum to the KIP would be a good idea one we finish the review here. 
   Wdyt?




-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org