Skip to content

Conversation

@roekatz
Copy link
Contributor

@roekatz roekatz commented Dec 20, 2022

This solves the issue of the Redis lock (around the policy git clone) staying hanging forever (preventing new workers from cloning the repo). Probably because the app crashes with segfault before releasing the lock.

My solution is giving the lock an expiration time (enforced by Redis itself), keeping extending this timeout while we wait for fetch to finish. When the app crashes, the lock would expire and not hang forever.

I got this idea from this library which I had used before to solve a similar issue. But that library isn't async - So I've implemented the same idea myself (Not that complicated anyway).

@roekatz roekatz requested a review from asafc December 20, 2022 09:34
@netlify
Copy link

netlify bot commented Dec 20, 2022

Deploy Preview for opal-docs canceled.

Name Link
🔨 Latest commit 64ad081
🔍 Latest deploy log https://app.netlify.com/sites/opal-docs/deploys/63a1820ba2ed90000a5fb37a

@roekatz roekatz force-pushed the bugfix/hanging-redis-lock branch from 70bd29d to 64ad081 Compare December 20, 2022 09:36
@roekatz roekatz merged commit ccbde5e into master Dec 20, 2022
@roekatz roekatz deleted the bugfix/hanging-redis-lock branch December 20, 2022 09:58
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.

2 participants