StevenLuMT commented on code in PR #4488:
URL: https://github.com/apache/bookkeeper/pull/4488#discussion_r2045859387


##########
bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/SingleThreadExecutor.java:
##########
@@ -213,18 +233,30 @@ public void execute(Runnable r) {
                 queue.put(r);
                 tasksCount.increment();
             } else {
-                if (queue.offer(r)) {
-                    tasksCount.increment();
+                int delta = r != null ? 1 : runnableList.size();
+                validateQueueCapacity(delta);

Review Comment:
   <img width="784" alt="image" 
src="https://github.com/user-attachments/assets/b611af75-f511-4847-9e76-46e94df155c6";
 />
   
   If a null is passed in here, will runnableList.size() report a 
NullPointerException? This may affect the function of public void 
execute(Runnable r)



-- 
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