From f7d2eda120867b3c5a2d9001d5f5c9d0396c65bd Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期二, 14 四月 2026 12:41:13 +0800
Subject: [PATCH] #命令下发队列优化

---
 src/main/java/com/zy/core/thread/impl/station/StationSegmentExecutor.java |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/main/java/com/zy/core/thread/impl/station/StationSegmentExecutor.java b/src/main/java/com/zy/core/thread/impl/station/StationSegmentExecutor.java
index 9647384..21496f0 100644
--- a/src/main/java/com/zy/core/thread/impl/station/StationSegmentExecutor.java
+++ b/src/main/java/com/zy/core/thread/impl/station/StationSegmentExecutor.java
@@ -241,15 +241,19 @@
                                          Integer currentStationId) {
         // 鍦ㄤ笅鍙戞柊鍒嗘鍓嶆鏌ヨ矾鐢辩増鏈槸鍚︿粛鐒舵湁鏁堬紝閬垮厤鍦ㄨ矾鐢辩増鏈凡鏇存柊鐨勬儏鍐典笅涓嬪彂鏃х増鏈懡浠�
         if (!isRouteDispatchable(command == null ? null : command.getTaskNo(), command == null ? null : command.getRouteVersion())) {
-            if (traceRegistry != null && command != null) {
-                traceRegistry.markCancelled(command.getTaskNo(), traceVersion, currentStationId,
-                        buildDetails("reason", "route_version_replaced_before_segment_send", "routeVersion", command.getRouteVersion()));
+            // 棣栨鏍¢獙澶辫触鍙兘鏄� Redis 鍐欏叆寤惰繜瀵艰嚧鐨勶紝鐭殏绛夊緟鍚庨噸璇曚竴娆°��
+            sleepQuietly(50L);
+            if (!isRouteDispatchable(command == null ? null : command.getTaskNo(), command == null ? null : command.getRouteVersion())) {
+                if (traceRegistry != null && command != null) {
+                    traceRegistry.markCancelled(command.getTaskNo(), traceVersion, currentStationId,
+                            buildDetails("reason", "route_version_replaced_before_segment_send", "routeVersion", command.getRouteVersion()));
+                }
+                markCancelled(command == null ? null : command.getTaskNo(),
+                        command == null ? null : command.getRouteVersion(),
+                        currentStationId,
+                        "route_version_replaced_before_segment_send");
+                return false;
             }
-            markCancelled(command == null ? null : command.getTaskNo(),
-                    command == null ? null : command.getRouteVersion(),
-                    currentStationId,
-                    "route_version_replaced_before_segment_send");
-            return false;
         }
         
         while (true) {

--
Gitblit v1.9.1