Code Monkey home page Code Monkey logo

Comments (7)

unusual-thoughts avatar unusual-thoughts commented on June 15, 2024

somehow the original report has been deleted in the meantime, and this results in a new report object with an empty log save for the Started/Finished lines

from django-uwsgi-taskmanager.

guglielmo avatar guglielmo commented on June 15, 2024

I need a bit of information to try and help you.

How are you using the taskmanager (are you trying the demo project or are you using it inside one of your projects)?
Which django, and python releases are you using? I can see python 3.9, but what release of django?
When did this happen? While saving a report, but what kind of task where you running?

from django-uwsgi-taskmanager.

unusual-thoughts avatar unusual-thoughts commented on June 15, 2024

Hi! I am using the taskmanager inside of my project
The issue doesn't happen with scheduled, recurring tasks.
The problem task is started this way (inside a view)

Task.objects.filter(category__name="x", command__app_name="x", command__name="x", arguments="x").first().launch()

I am running django 3.1.4

from django-uwsgi-taskmanager.

unusual-thoughts avatar unusual-thoughts commented on June 15, 2024

This is almost definitely due to self.keep_last_n_reports() being called right after spooling, in the original thread. This has a race condition that can delete the report that has just been created in the spooler process. So when the spooler process then tries to update the report, it is already gone.
So:

  • keep_last_n_reports should probably be run just before spooling, or at the end of exec_command_task
  • use a transaction and select_for_update, or remove update_fields in report_obj.save

from django-uwsgi-taskmanager.

unusual-thoughts avatar unusual-thoughts commented on June 15, 2024

actually keep_last_n_reports is already run at the end of exec_command_task, so no need to run before spooling

from django-uwsgi-taskmanager.

guglielmo avatar guglielmo commented on June 15, 2024

Seems like a good one. Will merge.

from django-uwsgi-taskmanager.

guglielmo avatar guglielmo commented on June 15, 2024

Problem has beel fixed in release 2.2.9

from django-uwsgi-taskmanager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.