YongGoose commented on code in PR #7133:
URL: https://github.com/apache/incubator-seata/pull/7133#discussion_r1955423749


##########
server/src/main/java/org/apache/seata/server/session/GlobalSession.java:
##########
@@ -204,9 +204,17 @@ public boolean isTimeout() {
 
     /**
      * prevent could not handle committing and rollbacking transaction
+     *
+     * If the global session's status is "Rollbacked" or "TimeoutRollbacked", 
it returns the negative time since the session began,
+     * indicating that the session is already dead.
+     * For other statuses, it returns the remaining time until the session 
reaches the retry dead threshold.
+     *
      * @return time to dead session. if not greater than 0, then deadSession
      */
     public long timeToDeadSession() {
+        if (this.status == GlobalStatus.Rollbacked || this.status == 
GlobalStatus.TimeoutRollbacked) {
+            return beginTime - System.currentTimeMillis();

Review Comment:
   Then, would it be appropriate to create a `RETRY_DEAD_THRESHOLD` 
specifically for the end state?
   
   > Of course, this timeToDeadSession method is more relevant for ongoing 
statuses like "rollbacking" or "committing." For transactions in the "end" 
status, I believe the interval can be shortened.
   
   As suggested in the discussion, since we can reduce the interval in the end 
state, I believe decreasing the size of `RETRY_DEAD_THRESHOLD` could be a 
reasonable approach.



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

Reply via email to