AlbumenJ commented on code in PR #13196:
URL: https://github.com/apache/dubbo/pull/13196#discussion_r1358035005


##########
dubbo-common/src/main/java/org/apache/dubbo/common/threadpool/serial/SerializingExecutor.java:
##########
@@ -26,14 +26,13 @@
 import org.apache.dubbo.common.threadlocal.InternalThreadLocalMap;
 
 import static 
org.apache.dubbo.common.constants.LoggerCodeConstants.COMMON_ERROR_RUN_THREAD_TASK;
-import static org.apache.dubbo.common.utils.ExecutorUtil.isShutdown;
 
 /**
  * Executor ensuring that all {@link Runnable} tasks submitted are executed in 
order
  * using the provided {@link Executor}, and serially such that no two will 
ever be
  * running at the same time.
  */
-public final class SerializingExecutor implements Executor, Runnable {
+public class SerializingExecutor implements Executor, Runnable {

Review Comment:
   Change to abstract class would be better?



##########
dubbo-common/src/main/java/org/apache/dubbo/common/threadpool/serial/SafeSerializingExecutor.java:
##########
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.dubbo.common.threadpool.serial;
+
+import java.util.concurrent.Executor;
+
+import static org.apache.dubbo.common.utils.ExecutorUtil.isShutdown;
+
+/**
+ * If the thread pool is in a shutdown state, won't submit task, so it doesn't 
throw reject exception
+ */
+public class SafeSerializingExecutor extends SerializingExecutor {

Review Comment:
   Rename to "SubmitSafeSerializingExecutor" or something more reasonable.
   Only `Safe` is a little wired.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to