Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
worker: always create subtasks on the same worker
... to fix the following crash due to race between the automated task assignment to workers by the hub and the `hub.worker.assign_task` XML-RPC method. This commit also introduces a hard dependency on Kobo 0.32.0 or newer. ``` Traceback (most recent call last): File "/usr/lib/python3.9/site-packages/kobo/worker/taskmanager.py", line 423, in run_task task.run() File "/usr/lib/python3.9/site-packages/osh/worker/tasks/task_errata_diff_build.py", line 52, in run self.hub.worker.assign_task(subtask_id) File "/usr/lib64/python3.9/xmlrpc/client.py", line 1122, in __call__ return self.__send(self.__name, args) File "/usr/lib64/python3.9/xmlrpc/client.py", line 1464, in __request response = self.__transport.request( File "/usr/lib/python3.9/site-packages/kobo/xmlrpc.py", line 598, in request result = transport_class.request(self, *args, **kwargs) File "/usr/lib64/python3.9/xmlrpc/client.py", line 1166, in request return self.single_request(host, handler, request_body, verbose) File "/usr/lib/python3.9/site-packages/kobo/xmlrpc.py", line 511, in _single_request3 return self.parse_response(response) File "/usr/lib64/python3.9/xmlrpc/client.py", line 1354, in parse_response return u.close() File "/usr/lib64/python3.9/xmlrpc/client.py", line 668, in close raise Fault(**self._stack[0]) xmlrpc.client.Fault: <Fault 1: Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/kobo/hub/models.py", line 861, in assign_task self.__lock(worker_id, new_state=TASK_STATES["ASSIGNED"], initial_states=(TASK_STATES["FREE"], TASK_STATES["CREATED"])) File "/usr/lib/python3.6/site-packages/kobo/hub/models.py", line 836, in __lock raise ObjectDoesNotExist() django.core.exceptions.ObjectDoesNotExist ``` Related: release-engineering/kobo#230 Resolves: openscanhub#156 Resolves: https://issues.redhat.com/browse/OSH-358
- Loading branch information