funky-eyes commented on code in PR #6499: URL: https://github.com/apache/incubator-seata/pull/6499#discussion_r1580545087
########## server/src/main/java/org/apache/seata/server/coordinator/DefaultCoordinator.java: ########## @@ -488,6 +498,96 @@ private boolean isRetryTimeout(long now, long timeout, long beginTime) { return timeout >= ALWAYS_RETRY_BOUNDARY && now - beginTime > timeout; } + /** + * Handle rollbacking by scheduled. + */ + protected void handleRollbackingByScheduled() { + SessionCondition sessionCondition = new SessionCondition(rollbackingStatuses); + sessionCondition.setLazyLoadBranch(true); + List<GlobalSession> rollbackingSessions = + SessionHolder.getRootSessionManager().findGlobalSessions(sessionCondition); + if (CollectionUtils.isEmpty(rollbackingSessions)) { + rollbackingSchedule(DEFAULT_SYNC_PROCESSING_DELAY); + return; + } + rollbackingSessions.sort(Comparator.comparingLong(GlobalSession::getBeginTime)); + //The first one is the oldest one. + GlobalSession globalSession = rollbackingSessions.get(0); + if (!globalSession.isDeadSession()) { + rollbackingSchedule(System.currentTimeMillis() - globalSession.getBeginTime()); Review Comment: > > 应该是begintime+上间隔时间,减去当前时间还剩余多时间 It should be begintime + margin time, subtract the current time and how much time is left > > RETRY_DEAD_THRESHOLD支持动态调整吗?如果是,那可能需要取globalSession中的值? Does RETRY_DEAD_THRESHOLD support dynamic adjustment? If so, it may need to take the value in globalSession? 不允许运行中动态调整,支持启动前设置该值 Dynamic adjustment during operation is not allowed, and setting this value before startup is supported. -- 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: notifications-unsubscr...@seata.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org For additional commands, e-mail: notifications-h...@seata.apache.org