apache / rocketmq

Apache RocketMQ is a cloud native messaging and streaming platform, making it simple to build event-driven applications.
https://rocketmq.apache.org/
Apache License 2.0
21.19k stars 11.67k forks source link

Rocketmq broker restart causes consumer delay too much In k8s #2763

Closed sN0wpeak closed 2 years ago

sN0wpeak commented 3 years ago

BUG REPORT

  1. Please describe the issue you observed:

https://github.com/apache/rocketmq/blob/39bb9386f10d5d8dfe81183c172a3a86f6d313bd/client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java#L256

https://github.com/apache/rocketmq/blob/39bb9386f10d5d8dfe81183c172a3a86f6d313bd/client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java#L107

https://github.com/apache/rocketmq/blob/9f95a972e10e0681bc3f2d00e9957aa212e897b5/client/src/main/java/org/apache/rocketmq/client/consumer/store/RemoteBrokerOffsetStore.java#L216

MQClientInstance creates a ScheduledExecutorService(just one thread) to execute 5 functions serially, the persistAllConsumerOffset persist ConsumerOffset to broker with 5-sec timeout.

In k8s, IP to change when Broker restart. If MQClientInstance is calling persistAllConsumerOffset that time causes cost 50 * 5 sec and not call updateTopicRouteInfoFromNameServer. Because the old Broker IP is unavailable.

5 minutes later, The consumer is starting to consume until updateTopicRouteInfoFromNameServer is call.

  1. Please tell us about your environment: 4.7.0
  2. Other information
github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 365 days with no activity. It will be closed in 3 days if no further activity occurs.

github-actions[bot] commented 2 years ago

This issue was closed because it has been inactive for 3 days since being marked as stale.