Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

TypeError: '<' not supported between instances of 'AsyncUpdateTaskAction' and 'AsyncUpdateTaskAction' #153

Open
punkymaniac opened this issue Oct 7, 2020 · 1 comment

Comments

@punkymaniac
Copy link
Contributor

With multiple tasks scheduled, I regularly catch this error and the daemon stop to process scheduled scan.

Exception in thread Thread-1:                               
Traceback (most recent call last):           
  File "/usr/lib64/python3.6/threading.py", line 916, in _bootstrap_inner                           
    self.run()                                        
  File "/usr/lib64/python3.6/threading.py", line 864, in run                                                 
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.6/site-packages/openscap_daemon/dbus_daemon.py", line 45, in <lambda>  
    target=lambda: self.system.schedule_tasks_worker()
  File "/usr/local/lib/python3.6/site-packages/openscap_daemon/system.py", line 575, in schedule_tasks_worker
    self.schedule_tasks(reference_datetime)
  File "/usr/local/lib/python3.6/site-packages/openscap_daemon/system.py", line 545, in schedule_tasks
    TASK_ACTION_PRIORITY              
  File "/usr/local/lib/python3.6/site-packages/openscap_daemon/async_tools.py", line 162, in enqueue
    self.queue.put((priority, action))
  File "/usr/lib64/python3.6/queue.py", line 143, in put                                             
    self._put(item)                           
  File "/usr/lib64/python3.6/queue.py", line 227, in _put              
    heappush(self.queue, item)                
TypeError: '<' not supported between instances of 'AsyncUpdateTaskAction' and 'AsyncUpdateTaskAction'

I need to remove all task (or I can keep only one) and restart the daemon to return in a working state.
I continue to investigate to find a state where I can reproduce the error each time.
Someone have already get the same error ?

@punkymaniac
Copy link
Contributor Author

The issue came from a tuple comparison, when a tuple is add on the AsyncManager class queue.
The class AsyncUpdateTaskAction doesn't have a lower comparison operator, so they couldn't be compare with each other.
I will propose a fix for it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant