testjob_init_handler signal conflicts with .only()
Try running
t = TestJob.objects.only("pk", "actual_device_id").first()
What happens is:
Unable to execute signal 'testjob_init_handler', ignoring
maximum recursion depth exceeded while calling a Python object
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/lava_scheduler_app/signals.py", line 30, in function_wrapper
return func(*args, **kwargs)
File "/usr/lib/python3/dist-packages/lava_scheduler_app/signals.py", line 124, in testjob_init_handler
instance._old_state = instance.state
File "/usr/lib/python3/dist-packages/django/db/models/query_utils.py", line 135, in __get__
instance.refresh_from_db(fields=[self.field_name])
File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 619, in refresh_from_db
db_instance_qs = self.__class__._base_manager.db_manager(using, hints=hints).filter(pk=self.pk)
File "/usr/lib/python3/dist-packages/django/db/models/manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/lib/python3/dist-packages/django/db/models/manager.py", line 144, in get_queryset
return self._queryset_class(model=self.model, using=self._db, hints=self._hints)
File "/usr/lib/python3/dist-packages/django/db/models/query.py", line 193, in __init__
self.query = query or sql.Query(self.model)
File "/usr/lib/python3/dist-packages/django/db/models/sql/query.py", line 155, in __init__
self.alias_map = OrderedDict()
RecursionError: maximum recursion depth exceeded while calling a Python object
The reason is testjob_init_handler
wants to access health
and state
attributes which triggers TestJob models initialisation which triggers testjob_init_handler
...
Django advises against using signals so I think there is a room for argument to replace signals with a more explicit code.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information