Jason918 commented on a change in pull request #3509:
URL: https://github.com/apache/rocketmq/pull/3509#discussion_r752818988



##########
File path: broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java
##########
@@ -650,10 +652,13 @@ public void protectBroker() {
 
     public long headSlowTimeMills(BlockingQueue<Runnable> q) {
         long slowTimeMills = 0;
-        final Runnable peek = q.peek();
-        if (peek != null) {
-            RequestTask rt = BrokerFastFailure.castRunnable(peek);
-            slowTimeMills = rt == null ? 0 : this.messageStore.now() - 
rt.getCreateTimestamp();
+        Optional<RequestTask> op = q.stream()

Review comment:
       I am a little confusing about this. We are using 
`java.util.concurrent.LinkedBlockingQueue` for this `q`, and it should be 
thread safe. Can you give a detailed example for this change to work?




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to