-
Notifications
You must be signed in to change notification settings - Fork 50
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
CHG use distributed locks to distribute theia-poller job #401
Comments
Basically as it is done here: Anubis/api/anubis/k8s/pipeline.py Lines 175 to 241 in a075c56
Just need to lock the IDE resource as the submissions are locked here. We may want to formalize the way the locks are done here a bit. Maybe make a single function for creating the lock and releasing the lock. There is also a >>> from pottery import synchronize
>>> @synchronize(key='synchronized-func', masters={redis}, auto_release_time=1.5, blocking=True, timeout=-1)
... def func():
... # Only one thread can execute this function at a time.
... return True
...
>>> func()
True
>>> |
The poller job is a job thats sole purpose is to make sure that the database entries for IDEs match the resources allocated. This means looking at the kubernetes resources allocated and updating IDE database entries. Right now only one of these runs at a time. It is pretty much the only piece of Anubis that is a single point of failure. If for whatever reason the poller goes away, IDE states will not be updated. This will make launching or stopping IDEs impossible (which would be a huge problem).
We'll be able to run more than a single instance of redis poller if we can use distributed locks to ensure consistency and synchronization.
redis distributed locks: https://redis.io/docs/reference/patterns/distributed-locks/
python lib: https://github.com/brainix/pottery#redlock
poller job right now: https://github.com/AnubisLMS/Anubis/blob/a5e3f004076c108f6ec8819f9ee7c099eb639fc1/api/anubis/jobs/ide_poller.py
The text was updated successfully, but these errors were encountered: