[jira] [Commented] (KAFKA-5289) One StopReplicaRequest will caused two Responses
[ https://issues.apache.org/jira/browse/KAFKA-5289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16019532#comment-16019532 ] ASF GitHub Bot commented on KAFKA-5289: --- Github user asfgit closed the pull request at: https://github.com/apache/kafka/pull/3096 > 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: 0.10.0.0 >Reporter: xuzq >Assignee: Ismael Juma >Priority: Critical > Fix For: 0.11.0.0, 0.11.1.0 > > Attachments: handleStopReplicaRequest.png, KAFKA-5289.patch > > > 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 (v6.3.15#6346)
[jira] [Commented] (KAFKA-5289) One StopReplicaRequest will caused two Responses
[ https://issues.apache.org/jira/browse/KAFKA-5289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16017122#comment-16017122 ] Ismael Juma commented on KAFKA-5289: [~xuzq_zander], because we don't to delay the response while the idle threads are being shutdown. [~markTC], both questions are important, actually. Yes, `KafkaApis` should protect itself against exceptions if it performs an operation after the response is sent, but there could also have been a bug in `shutdownIdleFetcherThreads()` (and hence the question). > 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: 0.10.0.0 >Reporter: xuzq >Assignee: Ismael Juma >Priority: Critical > Fix For: 0.11.0.0 > > 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 (v6.3.15#6346)
[jira] [Commented] (KAFKA-5289) One StopReplicaRequest will caused two Responses
[ https://issues.apache.org/jira/browse/KAFKA-5289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16017111#comment-16017111 ] 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: 0.10.0.0 >Reporter: xuzq >Assignee: Ismael Juma >Priority: Critical > Fix For: 0.11.0.0 > > 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 (v6.3.15#6346)
[jira] [Commented] (KAFKA-5289) One StopReplicaRequest will caused two Responses
[ https://issues.apache.org/jira/browse/KAFKA-5289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16017105#comment-16017105 ] xuzq commented on KAFKA-5289: - [~ijuma] Why not put the line 'requestChannel.sendResponse(new RequestChannel.Response(request, new ResponseSend(request.connectionId, responseHeader, response)))' in the last row of the method handleStopReplicaRequest(request: RequestChannel.Request)? > 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: 0.10.0.0 >Reporter: xuzq >Assignee: Ismael Juma >Priority: Critical > Fix For: 0.11.0.0 > > 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 (v6.3.15#6346)
[jira] [Commented] (KAFKA-5289) One StopReplicaRequest will caused two Responses
[ https://issues.apache.org/jira/browse/KAFKA-5289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16017102#comment-16017102 ] ASF GitHub Bot commented on KAFKA-5289: --- GitHub user ijuma opened a pull request: https://github.com/apache/kafka/pull/3096 KAFKA-5289: handleStopReplica should not send a second response `shutdownIdleFetcherThreads()` can throw InterruptedException for example. You can merge this pull request into a Git repository by running: $ git pull https://github.com/ijuma/kafka kafka-5289-stop-replica-should-not-send-two-responses Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/3096.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3096 commit 09eb235157af651dacf4397c7ac84815937fa425 Author: Ismael JumaDate: 2017-05-19T09:11:26Z KAFKA-5289: handleStopReplica should not send a second response `shutdownIdleFetcherThreads()` can throw InterruptedException for example. > 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: 0.10.0.0 >Reporter: xuzq >Priority: Critical > Fix For: 0.11.0.0 > > 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 (v6.3.15#6346)
[jira] [Commented] (KAFKA-5289) One StopReplicaRequest will caused two Responses
[ https://issues.apache.org/jira/browse/KAFKA-5289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16017098#comment-16017098 ] xuzq commented on KAFKA-5289: - We overwrote the ReplicaFetcherManager class, and threw an exception in method shutdownIdleFetcherThreads(). In the original code, an exceptions will be threw in fetcher.shutdown(), such as InterruptedException when the thread interrupted. > 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: 0.10.0.0 >Reporter: xuzq >Priority: Critical > 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 (v6.3.15#6346)
[jira] [Commented] (KAFKA-5289) One StopReplicaRequest will caused two Responses
[ https://issues.apache.org/jira/browse/KAFKA-5289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16017075#comment-16017075 ] Ismael Juma commented on KAFKA-5289: Thanks for the report. Great catch. What kind of exceptions can `shutdownIdleFetcherThreads()` throw? > 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: 0.10.0.0 >Reporter: xuzq >Priority: Critical > 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 'requestChannel.sendResponse(new RequestChannel.Response(request, > new ResponseSend(request.connectionId, responseHeader, response)))' and > another at 'requestChannel.sendResponse(new Response(request, new > ResponseSend(request.connectionId, respHeader, response)))'. -- This message was sent by Atlassian JIRA (v6.3.15#6346)