Ma Tianchi commented on KAFKA-5289:

I think the importation thing is not "What kind of exceptions can 
`shutdownIdleFetcherThreads()` throw?".It is that 
requestChannel.sendResponse(new RequestChannel.Response(request, new 
ResponseSend() should be put at the last line.Even though the 
shutdownIdleFetcherThreads() throw nothing,but it is very danger. Because if an 
error be thrown after send  requestChannel.sendResponse,the error will be 
caught by KafkaApi and cause StopReplicaRequest.handleError which will send 
response again.

> One StopReplicaRequest will caused two Responses
> ------------------------------------------------
>                 Key: KAFKA-5289
>                 URL: https://issues.apache.org/jira/browse/KAFKA-5289
>             Project: Kafka
>          Issue Type: Bug
>          Components: core
>    Affects Versions:
>            Reporter: xuzq
>            Assignee: Ismael Juma
>            Priority: Critical
>             Fix For:
>         Attachments: handleStopReplicaRequest.png
> After discussed with my friend markTC´╝îwe find a bug.
> One StopReplicaRequest will caused two Responses.
> At core/src/main/scala/kafka/server/KafkaApi.class 175 and 176 lines.
> When an exception caused at 
> 'replicaManager.replicaFetcherManager.shutdownIdleFetcherThreads()', 
> will also return two responses.
> one is at 175 lines 'requestChannel.sendResponse(new 
> RequestChannel.Response(request, new ResponseSend(request.connectionId, 
> responseHeader, response)))' and another at 111 lines 
> 'requestChannel.sendResponse(new Response(request, new 
> ResponseSend(request.connectionId, respHeader, response)))'.

This message was sent by Atlassian JIRA

Reply via email to