actiontech/txle

[risk][Compensable][retries]When the set retries value is less than -1, there is a risk of overflow

Closed this issue · 2 comments

Describe The Bug

When the set retries value is less than -1, the retries value is always reduced , there is a risk of overflow

TXLE Version

https://github.com/actiontech/txle/commit/6bd946510f1515943e46c135d37eb1f183f30673

To Reproduce

Steps to reproduce the behavior:

  1. The first sub-transaction annotation Compensable parameter retries = -2147483648
    image
  2. Trigger the first sub-transaction exception, causing the retry event

Real Result

retries overflow
image

Suggestion

Less than 0, unlimited retry;
Equal to 0, do not retry;
Greater than 0, retry n times;

Fixed.
Less than 0, unlimited retry;
Equal to 0, do not retry;
Greater than 0, retry n times;

See the commit log.

VERSION:

6bd9465

Verification:

  1. retries = 3, retry 3 times
    image
  2. retries = 0, do not retry
    image
  3. retries = -1, unlimited retry
    image
  4. retries = -2147483648, unlimited retry, the retries value keep Original value
    image
    image