You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/03/04 09:55:21 UTC

[GitHub] [rocketmq] qsrg opened a new issue #3929: producer may blocked until timeout when broker server crashed

qsrg opened a new issue #3929:
URL: https://github.com/apache/rocketmq/issues/3929


   rocketmq:4.4.0
   I find when broker server crashed,the sync producer will blocked until timeout in some times,then throws RemotingTimeoutException: wait response on the channel ...
   
   ```
   //org.apache.rocketmq.remoting.netty.NettyRemotingAbstract#invokeSyncImpl   
               // broker 异常宕机可能会导致生产者等待响应直到超时
               RemotingCommand responseCommand = responseFuture.waitResponse(timeoutMillis);
               if (null == responseCommand) {
                   if (responseFuture.isSendRequestOK()) {
                       throw new RemotingTimeoutException(RemotingHelper.parseSocketAddressAddr(addr), timeoutMillis,
                           responseFuture.getCause());
                   } else {
                       throw new RemotingSendRequestException(RemotingHelper.parseSocketAddressAddr(addr), responseFuture.getCause());
                   }
               }
   
   ```
   it seems the message has send to broker, when producer waitResponse the broker has crashed at the same time, cause producer  blocked in `waitResponse` until timeout 。In this case, producer can't retry,Is this a probleem?


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq] ni-ze commented on issue #3929: producer may blocked until timeout when broker server crashed

Posted by GitBox <gi...@apache.org>.
ni-ze commented on issue #3929:
URL: https://github.com/apache/rocketmq/issues/3929#issuecomment-1060099611


   No, It's not a problem, message will be resend to other broke in method DefaultMQProducerImpl#sendDefaultImpl.


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq] fengjianjun1 commented on issue #3929: producer may blocked until timeout when broker server crashed

Posted by GitBox <gi...@apache.org>.
fengjianjun1 commented on issue #3929:
URL: https://github.com/apache/rocketmq/issues/3929#issuecomment-1064862890


   我感觉大部分是中国的吧,打点汉字吧   看着舒服~~


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq] qsrg commented on issue #3929: producer may blocked until timeout when broker server crashed

Posted by GitBox <gi...@apache.org>.
qsrg commented on issue #3929:
URL: https://github.com/apache/rocketmq/issues/3929#issuecomment-1060136671


   @panzhi33 @RongtongJin 


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq] ni-ze commented on issue #3929: producer may blocked until timeout when broker server crashed

Posted by GitBox <gi...@apache.org>.
ni-ze commented on issue #3929:
URL: https://github.com/apache/rocketmq/issues/3929#issuecomment-1060114568


   > 
   
   yeah. retry to other messageQueue.


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq] qsrg commented on issue #3929: producer may blocked until timeout when broker server crashed

Posted by GitBox <gi...@apache.org>.
qsrg commented on issue #3929:
URL: https://github.com/apache/rocketmq/issues/3929#issuecomment-1060153580


   > You can set a send message timeout by:
   > 
   > ```java
   > producer.setSendMsgTimeout();
   > 
   > //or
   > producer.send(msg, sendTimeout);
   > ```
   
   org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl#sendDefaultImpl
   ```
               for (; times < timesTotal; times++) {
   //...
                           if (timeout < costTime) {
                               callTimeout = true;
                               break;
                           }
   ```
   the timeout parameter will be passed to the method `nvokeSyncImpl` and exhausted in `responseFuture.waitResponse `,no matter how much timeout setted,so producer  can't retry


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq] qsrg commented on issue #3929: producer may blocked until timeout when broker server crashed

Posted by GitBox <gi...@apache.org>.
qsrg commented on issue #3929:
URL: https://github.com/apache/rocketmq/issues/3929#issuecomment-1062584127


   @ni-ze I don't agree with you,  I think it's better to wake up producer's waiting state let it has enough time to retry when the broker crashed


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq] qsrg commented on issue #3929: producer may blocked until timeout when broker server crashed

Posted by GitBox <gi...@apache.org>.
qsrg commented on issue #3929:
URL: https://github.com/apache/rocketmq/issues/3929#issuecomment-1060112263


   @ni-ze as there is no time left,sendDefaultImpl will break to resend


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq] wangazhang commented on issue #3929: producer may blocked until timeout when broker server crashed

Posted by GitBox <gi...@apache.org>.
wangazhang commented on issue #3929:
URL: https://github.com/apache/rocketmq/issues/3929#issuecomment-1064865185


   > 我感觉大部分是中国的吧,打点汉字吧 看着舒服~~
   
   english is better ,the official recommended


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq] qsrg edited a comment on issue #3929: producer may blocked until timeout when broker server crashed

Posted by GitBox <gi...@apache.org>.
qsrg edited a comment on issue #3929:
URL: https://github.com/apache/rocketmq/issues/3929#issuecomment-1060153580


   > You can set a send message timeout by:
   > 
   > ```java
   > producer.setSendMsgTimeout();
   > 
   > //or
   > producer.send(msg, sendTimeout);
   > ```
   
   org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl#sendDefaultImpl
   ```
               for (; times < timesTotal; times++) {
   //...
                           if (timeout < costTime) {
                               callTimeout = true;
                               break;
                           }
   ```
   the timeout parameter will be passed to the method `nvokeSyncImpl` and exhausted in `responseFuture.waitResponse `,no matter how much timeout setted. so producer  can't retry


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq] qsrg edited a comment on issue #3929: producer may blocked until timeout when broker server crashed

Posted by GitBox <gi...@apache.org>.
qsrg edited a comment on issue #3929:
URL: https://github.com/apache/rocketmq/issues/3929#issuecomment-1060136671


   @panzhi33 @RongtongJin help


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq] francisoliverlee commented on issue #3929: producer may blocked until timeout when broker server crashed

Posted by GitBox <gi...@apache.org>.
francisoliverlee commented on issue #3929:
URL: https://github.com/apache/rocketmq/issues/3929#issuecomment-1064866317


   IMO
   one broker crashed, it would be better for producers immediately to retry anthoer broker after broker response with crash error, not block.
   how `responseFuture.waitResponse(timeoutMillis)`  does maters
   


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq] francisoliverlee edited a comment on issue #3929: producer may blocked until timeout when broker server crashed

Posted by GitBox <gi...@apache.org>.
francisoliverlee edited a comment on issue #3929:
URL: https://github.com/apache/rocketmq/issues/3929#issuecomment-1064866317


   IMO
   one broker crashed, it would be better for producers immediately to retry anthoer broker after broker response with crash error, not block.
   how `responseFuture.waitResponse(timeoutMillis)`  does maters
   if broker crash && responseFuture.waitResponse(timeoutMillis) return immediately
   client can retry immediately ( good)
   
   if broker crash && responseFuture.waitResponse(timeoutMillis) wait for timeout
   client retry after timeout ( not good)


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq] ni-ze commented on issue #3929: producer may blocked until timeout when broker server crashed

Posted by GitBox <gi...@apache.org>.
ni-ze commented on issue #3929:
URL: https://github.com/apache/rocketmq/issues/3929#issuecomment-1060144525


   You can set a send message timeout by:
   ```java
   producer.setSendMsgTimeout();
   
   //or
   producer.send(msg, sendTimeout);
   ``` 
   


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq] qsrg edited a comment on issue #3929: producer may blocked until timeout when broker server crashed

Posted by GitBox <gi...@apache.org>.
qsrg edited a comment on issue #3929:
URL: https://github.com/apache/rocketmq/issues/3929#issuecomment-1060153580


   > You can set a send message timeout by:
   > 
   > ```java
   > producer.setSendMsgTimeout();
   > 
   > //or
   > producer.send(msg, sendTimeout);
   > ```
   
   org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl#sendDefaultImpl
   ```
               for (; times < timesTotal; times++) {
   //...
                           if (timeout < costTime) {
                               callTimeout = true;
                               break;
                           }
   ```
   the timeout parameter will be passed to the method `NettyRemotingAbstract.invokeSyncImpl  ` and maybe exhausted in `responseFuture.waitResponse`,no matter how much timeout setted. so producer  may not try again


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq] qsrg edited a comment on issue #3929: producer may blocked until timeout when broker server crashed

Posted by GitBox <gi...@apache.org>.
qsrg edited a comment on issue #3929:
URL: https://github.com/apache/rocketmq/issues/3929#issuecomment-1060153580


   > You can set a send message timeout by:
   > 
   > ```java
   > producer.setSendMsgTimeout();
   > 
   > //or
   > producer.send(msg, sendTimeout);
   > ```
   
   org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl#sendDefaultImpl
   ```
               for (; times < timesTotal; times++) {
   //...
                           if (timeout < costTime) {
                               callTimeout = true;
                               break;
                           }
   ```
   the timeout parameter will be passed to the method `NettyRemotingAbstract.invokeSyncImpl  ` and exhausted in `responseFuture.waitResponse `,no matter how much timeout setted. so producer  can't retry


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq] ni-ze commented on issue #3929: producer may blocked until timeout when broker server crashed

Posted by GitBox <gi...@apache.org>.
ni-ze commented on issue #3929:
URL: https://github.com/apache/rocketmq/issues/3929#issuecomment-1060167053


   It does might happen, If an RemotingTimeoutException occurs on the first send, will not retry. An exception was thrown to the client, It's up to you how to handle it. If client retry to other messageQueue will break timeout semantics.


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq] qsrg commented on issue #3929: producer may blocked until timeout when broker server crashed

Posted by GitBox <gi...@apache.org>.
qsrg commented on issue #3929:
URL: https://github.com/apache/rocketmq/issues/3929#issuecomment-1064888342


    I'll fix it later 


-- 
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: dev-unsubscribe@rocketmq.apache.org

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