Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip collection of attempts when maxAttempts is Infinity #312

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Tithra
Copy link

@Tithra Tithra commented Feb 6, 2025

Potential issue in a scenario of retryCount = -1

In the scenario that an app instance can acquire to the lock while other instances wait for the lock, the attempts array will keep collecting stats as long as the routine() is still on hold. E.g. the app instance subscribes to external service for a regular polling may want to hold the lock forever until an error occurs or the app instance is down. That would eventually be a memory-leak issue in other app instances who wait for the lock, because each retry failed to obtain the lock => attempts array will collect 1 stats.

So in this scenario, there should be either a maximum limit for attempts to collect the stats, or may just skip the collection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant