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

lock: reuse redis client when creating locks (PROJQUAY-1872) #741

Merged
merged 1 commit into from
Apr 14, 2021

Conversation

kleesc
Copy link
Member

@kleesc kleesc commented Apr 13, 2021

By default, Redlock creates a new client per instance. Using the
provided factory allows Redlock to reuse a single connection per
instance and avoid running out of connections. e.g When a worker tries
to get a lock, it should not open new connections every time.

Increase sleep duration between queue polls on
WorkerSleepException. This will give more time before retrying after
failing to acquire a lock.

@kleesc kleesc requested a review from alecmerdler April 13, 2021 15:38
@kleesc kleesc force-pushed the reuse-redis-client-to-create-locks branch 6 times, most recently from c0da241 to c15d1e3 Compare April 13, 2021 19:30
util/locking.py Outdated Show resolved Hide resolved
@kleesc kleesc force-pushed the reuse-redis-client-to-create-locks branch 6 times, most recently from 4e59fff to 22ad0eb Compare April 14, 2021 02:10
By default, Redlock creates a new client per instance. Using the
provided factory allows Redlock to reuse a single connection per
instance and avoid running out of connections. e.g When a worker tries
to get a lock, it should not open new connections every time.

Increase sleep duration between queue polls on
WorkerSleepException. This will give more time before retrying after
failing to acquire a lock.
@kleesc kleesc force-pushed the reuse-redis-client-to-create-locks branch from 22ad0eb to 68c0bf5 Compare April 14, 2021 14:08
@kleesc kleesc merged commit 778afaf into quay:master Apr 14, 2021
@kleesc kleesc deleted the reuse-redis-client-to-create-locks branch April 14, 2021 15:39
kleesc added a commit to kleesc/quay that referenced this pull request Apr 14, 2021
By default, Redlock creates a new client per instance. Using the
provided factory allows Redlock to reuse a single connection per
instance and avoid running out of connections. e.g When a worker tries
to get a lock, it should not open new connections every time.

Increase sleep duration between queue polls on
WorkerSleepException. This will give more time before retrying after
failing to acquire a lock.
kleesc added a commit that referenced this pull request Apr 14, 2021
…744)

By default, Redlock creates a new client per instance. Using the
provided factory allows Redlock to reuse a single connection per
instance and avoid running out of connections. e.g When a worker tries
to get a lock, it should not open new connections every time.

Increase sleep duration between queue polls on
WorkerSleepException. This will give more time before retrying after
failing to acquire a lock.
syed pushed a commit to syed/quay that referenced this pull request Apr 19, 2021
By default, Redlock creates a new client per instance. Using the
provided factory allows Redlock to reuse a single connection per
instance and avoid running out of connections. e.g When a worker tries
to get a lock, it should not open new connections every time.

Increase sleep duration between queue polls on
WorkerSleepException. This will give more time before retrying after
failing to acquire a lock.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants