Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6702925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:06:38+00:00 2026-05-26T07:06:38+00:00

I already read the respective article in Celery docs ( Cookbook :: Creating Tasks

  • 0

I already read the respective article in Celery docs (Cookbook :: Creating Tasks), however I didn’t completely like the solution suggested. I have very long running tasks (from 15 minutes to 1 hour or possibly even more) and thus choosing some LOCK_EXPIRE setting doesn’t seem reliable: if it turns out too small, I get two tasks running simultaneously and if it is too big and a celery process dies for some reason, I’ll need to manually delete the locking cache key.

The idea that comes to my mind is that I could use two different locks: one created with fcntl.lockf (for different celery worker processes) and another one with threading.Lock() (when the task gets executed in the same celery process). However having two locks seems somewhat excessive.

So, my question is: what would be the simplest solution for my problem? It doesn’t have to be cross-platform and can support only Linux.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:06:39+00:00Added an answer on May 26, 2026 at 7:06 am

    Just use one lock without expiration, and create a periodic “investigator” Task that checks whether everything is ok, that is, if another Task died unexpectedly, it fixes the lock issue. As a plus, take a look here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I already read many article about this issue in here, SO. I just want
Scenario Having already read a post on this on the same site, which didn't
I have already read Josh Smiths article about binding commands to view model using
I guess many people already read this article: Using your own SQLite database in
I've already read the MSDN article about it. It seems internally it is the
I know this post , I've already read it but still I'd like to
I already read/tried these posts but that didn't help: Display multiple lines within a
I have already read through this . However, in my case the page I
I already read the datasheet and google but I still don't understand something. In
From what I've already read this appears to be impossible, but I wanted to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.