-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hub: support creation of subtasks with an inherited worker from parent task #230
Merged
rohanpm
merged 2 commits into
release-engineering:master
from
lzaoral:hub-create-preassigned-subtasks
Oct 19, 2023
Merged
hub: support creation of subtasks with an inherited worker from parent task #230
rohanpm
merged 2 commits into
release-engineering:master
from
lzaoral:hub-create-preassigned-subtasks
Oct 19, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... with worker and task state assertions.
…t task OpenScanHub expects the parent task and its subtasks to be executed on the same worker. However, there is a race with the `assign_task` XML-RPC call because it does not guarantee that the subtask won't be assigned to another worker by the hub in the meantime. This commit adds a support for creation of subtasks pre-assigned to the same worker executing the parent task, thus, invalidating the necessary condition for the race described above. Related: openscanhub/openscanhub#156
lzaoral
added a commit
to lzaoral/openscanhub
that referenced
this pull request
Oct 19, 2023
... 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. ``` 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
lzaoral
added a commit
to lzaoral/openscanhub
that referenced
this pull request
Oct 26, 2023
... 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
lzaoral
added a commit
to lzaoral/openscanhub
that referenced
this pull request
Nov 2, 2023
... 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
lzaoral
added a commit
to lzaoral/openscanhub
that referenced
this pull request
Nov 8, 2023
... 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
lzaoral
added a commit
to lzaoral/openscanhub
that referenced
this pull request
Nov 8, 2023
... 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
OpenScanHub expects the parent task and its subtasks to be executed on the
same worker. However, there is a race with the
assign_task
XML-RPC callbecause it does not guarantee that the subtask won't be assigned to another
worker by the hub in the meantime.
This commit adds a support for creation of subtasks pre-assigned to the
same worker executing the parent task, thus, invalidating the necessary
condition for the race described above.
Related: openscanhub/openscanhub#156