Skip to content

Allow for timeouts in acquiring a daemon lock#31

Draft
pratikmallya wants to merge 2 commits intomasterfrom
add-timeout-exception
Draft

Allow for timeouts in acquiring a daemon lock#31
pratikmallya wants to merge 2 commits intomasterfrom
add-timeout-exception

Conversation

@pratikmallya
Copy link
Copy Markdown

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