CA-426228: Fix race condition in run_xapi_async_tasks#235
Open
stephenchengCloud wants to merge 1 commit intomasterfrom
Open
CA-426228: Fix race condition in run_xapi_async_tasks#235stephenchengCloud wants to merge 1 commit intomasterfrom
stephenchengCloud wants to merge 1 commit intomasterfrom
Conversation
When multiple async xapi tasks are fired (e.g. VM.start_on), xapi may complete and garbage-collect a task before the polling loop reads its status. This causes task.get_status() to throw HANDLE_INVALID, crashing the test even though the operation succeeded. Signed-off-by: Stephen Cheng <stephen.cheng@citrix.com>
Collaborator
Author
|
After the fix, tested in the same machine: |
This file contains hidden or 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
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.
When multiple async xapi tasks are fired (e.g. VM.start_on), xapi may complete and garbage-collect a task before the polling loop reads its status. This causes task.get_status() to throw HANDLE_INVALID, crashing the test even though the operation succeeded.
2026-04-14 12:17:04,855 auto-cert-kit: ERROR testbase.py:182 Test Case Failure: test_tx_throughput
2026-04-14 12:17:04,856 auto-cert-kit: DEBUG testbase.py:183 Traceback (most recent call last):
File "/opt/xensource/packages/files/auto-cert-kit/testbase.py", line 143, in run_test
res = getattr(self, test)(self.session)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/xensource/packages/files/auto-cert-kit/network_tests.py", line 766, in test_tx_throughput
return self._run_test(session, direction)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/xensource/packages/files/auto-cert-kit/network_tests.py", line 1151, in _run_test
self.ops_test(session, vm_list)
File "/opt/xensource/packages/files/auto-cert-kit/network_tests.py", line 1325, in ops_test
start_droid_vms(session, [(master_ref, vm) for vm in vms])
File "/opt/xensource/packages/files/auto-cert-kit/utils.py", line 1988, in start_droid_vms
run_xapi_async_tasks(session,
File "/opt/xensource/packages/files/auto-cert-kit/utils.py", line 1716, in run_xapi_async_tasks
status = session.xenapi.task.get_status(ref)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/XenAPI.py", line 317, in call
return self.__send(self.__name, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/XenAPI.py", line 198, in xenapi_request
result = _parse_result(getattr(self, methodname)(*full_params))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/XenAPI.py", line 292, in _parse_result
raise Failure(result['ErrorDescription'])
XenAPI.Failure: ['HANDLE_INVALID', 'task', 'OpaqueRef:f5f33026-684e-9a42-29f3-533a69e56998']