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

Cannot extend a lock that's no longer owned #230

Open
cikay opened this issue Nov 21, 2022 · 3 comments
Open

Cannot extend a lock that's no longer owned #230

cikay opened this issue Nov 21, 2022 · 3 comments

Comments

@cikay
Copy link
Contributor

cikay commented Nov 21, 2022

I start the beat service it works however when I stop and start again even the beat works, logging wait for beat_max_loop_interval to tick as if there are no jobs. As time passed it throws Cannot extend a lock that's no longer owned but as I said it is working somewhere in the background, and neither any of the jobs cannot be deleted nor updated.

@hotwater9
Copy link

hotwater9 commented Jul 13, 2023

I run into the same problems as you, I do the same on my server. But when they work correctly for a while, the problem randomly arises. Nothing happens to the analysis log, as if the lock really expired and disappeared, but shouldn't it be renewed all the time?
So I was wondering if you found the problem?

@cikay
Copy link
Contributor Author

cikay commented Jul 13, 2023

I run into the same problems as you, I do the same on my server. But when they work correctly for a while, the problem randomly arises. Nothing happens to the analysis log, as if the lock really expired and disappeared, but shouldn't it be renewed all the time? So I was wondering if you found the problem?

I extend RedBeatScheduler and set max_interval to 10 it works.

from redbeat.schedulers import RedBeatScheduler as BaseScheduler

class RedBeatScheduler(BaseScheduler):
    max_interval = 10

It raises the error when waiting too much like minutes. Remember that you have to specify the extended schedule when running the beat something like below.

pipenv run celery beat --scheduler=<file_name>:RedBeatScheduler

@hotwater9
Copy link

but doesn't redbeat already have an automatic extension? If I remember correctly, when my scheduled task had to wait too long, it would only wait(sleep) five minutes by default. Do you mean I should set the default time to be shorter?

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

No branches or pull requests

2 participants