atomikos / transactions-essentials

Development repository for next major release of
https://www.atomikos.com/Main/TransactionsEssentials
Other
462 stars 139 forks source link

fix: stack overflow many retries #207

Closed klopfdreh closed 6 months ago

klopfdreh commented 6 months ago

Hey @GuyPardon - as promised here are the changes to prevent the stack overflow. The issue occurs when one process acquired the lock which is long living and a second one is also trying to acquire it, then the second one is trying to get the lock using a whole lot of retries. (recursion loops). This causes the stack overflow.

To prevent this, we are using a while loop now to not cause the stack overflow.

klopfdreh commented 6 months ago

Hey @GuyPardon - can you again push the changes to GitHub so that we can confirm them?

GuyPardon commented 6 months ago

Hi,

Our latest dev is now on GitHub. Recursion is limited to the max number of attempts; so what exactly is the bug?

Thanks

klopfdreh commented 6 months ago

As explained we faced a stack overflow when you have a very high number of retry attempts, by using a while loop there is no stack issue, but as I can see you might fixt the issue by moving the retry out of the catch block.

GuyPardon commented 6 months ago

Hi,

Not sure how to check, either please repost your changes or test with the latest version in our GitHub?

Otherwise, we can do a quick zoom if you prefer?

https://calendly.com/guypardon/15min

Thanks

Guy

klopfdreh commented 6 months ago

I saw your changes - you adjusted it a bit and I think there is no issue anymore as the count increase is outside of the catch, now - so all fine 👍