8000 Allow for timeouts in acquiring a daemon lock by pratikmallya · Pull Request #31 · LiveRamp/daemon_lib · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Allow for timeouts in acquiring a daemon lock #31

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pratikmallya
Copy link

The current code waits forever on acquiring a synchronization lock.
This can cause issues when there are a large number of daemons. In
such a case, the JVM can terminate after waiting for a long time.
This can often lead to confusion for users.

In this change we:

  • add a specific exception (LockTimeoutException) to indicate timeouts when acquiring locks and
  • handle that exception in the config fetching logic. This permits any
    lock implementation to throw the exception to indicate a timeout
    when trying to fetch the lock. The exception handler prints a
    helpful message allowing users to know that the Daemon is stalling
    on fetching the lock.

The current code waits forever on acquiring a synchronization lock.
This can cause issues when there are a large number of daemons. In
such a case, the JVM can terminate after waiting for a long time.
This can often lead to confusion for users.

In this change we:

* add a specific exception (LockTimeoutException) to indicate timeouts when acquiring locks and
* handle that exception in the config fetching logic. This permits any
  lock implementation to throw the exception to indicate a timeout
  when trying to fetch the lock. The exception handler prints a
  helpful message allowing users to know that the Daemon is stalling
  on fetching the lock.
@pratikmallya pratikmallya added the change/standard Trivial / minor changes that are low-impact, low risk label Dec 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change/standard Trivial / minor changes that are low-impact, low risk
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0