Skip to content

Add configuration with optional timeout to AcquireLock#24559

Merged
tobiaszheller merged 2 commits intomasterfrom
tobiaszheller/lock-configuration
Apr 14, 2023
Merged

Add configuration with optional timeout to AcquireLock#24559
tobiaszheller merged 2 commits intomasterfrom
tobiaszheller/lock-configuration

Conversation

@tobiaszheller
Copy link
Copy Markdown
Contributor

This PR adds option to configure retry timeout on acquiring lock. I need it in other PR, to avoid using default 250ms.

Comment thread lib/backend/helpers.go Outdated
@tobiaszheller tobiaszheller enabled auto-merge April 14, 2023 10:10
@tobiaszheller tobiaszheller added this pull request to the merge queue Apr 14, 2023
Merged via the queue into master with commit afb2e2b Apr 14, 2023
@tobiaszheller tobiaszheller deleted the tobiaszheller/lock-configuration branch April 14, 2023 10:48
rosstimothy pushed a commit that referenced this pull request Jul 27, 2023
* Add configuration with optional timeout to AcquireLock

* rename to RetryInterval
rosstimothy pushed a commit that referenced this pull request Jul 27, 2023
* Add configuration with optional timeout to AcquireLock

* rename to RetryInterval
github-merge-queue Bot pushed a commit that referenced this pull request Jul 28, 2023
* Add configuration with optional timeout to AcquireLock (#24559)

* Add configuration with optional timeout to AcquireLock

* rename to RetryInterval

* backport RunWhileLocked changes from #25639

* Hold Auth init lock for the duration of initialization (#29593)

Auth now uses `RunWhileLocked` instead of `AcquireLock` to ensure
that the initialization lock is held until the bootstrapping
process is completed. Prior, Auth only held the lock for 30s which
could allow multiple Auths to attempt bootstrapping simultaneously.
Initialization should complete prior to 30s in most cases, but it
is not guarateed, especially on first boot when CAs are being
generated and a large data migration may be needed.

---------

Co-authored-by: Tobiasz Heller <14020794+tobiaszheller@users.noreply.github.com>
github-merge-queue Bot pushed a commit that referenced this pull request Jul 28, 2023
* Add configuration with optional timeout to AcquireLock (#24559)

* Add configuration with optional timeout to AcquireLock

* rename to RetryInterval

* backport RunWhileLocked changes from #25639

* Hold Auth init lock for the duration of initialization (#29593)

Auth now uses `RunWhileLocked` instead of `AcquireLock` to ensure
that the initialization lock is held until the bootstrapping
process is completed. Prior, Auth only held the lock for 30s which
could allow multiple Auths to attempt bootstrapping simultaneously.
Initialization should complete prior to 30s in most cases, but it
is not guarateed, especially on first boot when CAs are being
generated and a large data migration may be needed.

---------

Co-authored-by: Tobiasz Heller <14020794+tobiaszheller@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants