django / djangoproject.com

Source code to djangoproject.com
https://www.djangoproject.com/
BSD 3-Clause "New" or "Revised" License
1.86k stars 939 forks source link

Evaluating: capability.save() did not finish after 3.00 seconds. #1530

Closed harshalizode closed 1 month ago

harshalizode commented 1 month ago

Hello Everyone,

I have the model for capability as:

class Capability(CustomModel):
    name = models.CharField(_('Name'), max_length=64, db_column='name', null=False, blank=False)
    code = models.CharField(_('Code'), max_length=64, db_column='code', null=False, blank=False)
    status = models.CharField(_('Status'),choices=settings.STATUS_CHOICES, default='I', max_length=1, db_column='status')

Here, I am attempting to update the state of the capability object.

capability = Capability.objects.get(id=1)
capability.status = 'A'
capability.save()

By saving the capability object, we receive the issue as:

Evaluating: capability.save() did not finish after 3.00 seconds.
This may mean a number of things:
- This evaluation is really slow and this is expected.
    In this case it's possible to silence this error by raising the timeout, setting the
    PYDEVD_WARN_EVALUATION_TIMEOUT environment variable to a bigger value.

- The evaluation may need other threads running while it's running:
    In this case, it's possible to set the PYDEVD_UNBLOCK_THREADS_TIMEOUT
    environment variable so that if after a given timeout an evaluation doesn't finish,
    other threads are unblocked or you can manually resume all threads.

    Alternatively, it's also possible to skip breaking on a particular thread by setting a
    `pydev_do_not_trace = True` attribute in the related threading.Thread instance
    (if some thread should always be running and no breakpoints are expected to be hit in it).

- The evaluation is deadlocked:
    In this case you may set the PYDEVD_THREAD_DUMP_ON_WARN_EVALUATION_TIMEOUT
    environment variable to true so that a thread dump is shown along with this message and
    optionally, set the PYDEVD_INTERRUPT_THREAD_TIMEOUT to some value so that the debugger
    tries to interrupt the evaluation (if possible) when this happens.

Can anything be wrong here? The other model's save method works as expected, but the Capability model is having trouble saving the object by updating its status.

Thank you.

bmispelon commented 1 month ago

Hi,

This ticket tracker is for issues with the website www.djangoproject.com, not for questions about Django itself. You should try the forum or the discord server for that: https://www.djangoproject.com/community/

Good luck, have a nice day! ✨

harshalizode commented 1 month ago

Okay, Thank you.