Correctly complete build on transient errors

Use the `completeBuild()` method for reporting the result on transient
errors during repo update instead of the old `sendWorkComplete()` API.

2023-04-28 12:29:49,173 ERROR zuul.AnsibleJob: [e: ...] [build: ...] Exception while executing job
Traceback (most recent call last):
  File "/opt/zuul/lib/python3.10/site-packages/zuul/executor/server.py", line 1144, in do_execute
    self._execute()
  File "/opt/zuul/lib/python3.10/site-packages/zuul/executor/server.py", line 1345, in _execute
    self.job.sendWorkComplete(
AttributeError: 'FrozenJob' object has no attribute 'sendWorkComplete'

Change-Id: I05be093f80f015463f727f55154e16202821e961
This commit is contained in:
Simon Westphahl 2023-05-02 10:52:42 +02:00
parent bbdbe81790
commit 515e6ab8f7
No known key found for this signature in database
1 changed files with 2 additions and 2 deletions

View File

@ -1338,8 +1338,8 @@ class AnsibleJob(object):
result=None,
error_detail=f'Failed to update project '
f'{task.project_name}')
self.job.sendWorkComplete(
json.dumps(result, sort_keys=True))
self.executor_server.completeBuild(
self.build_request, result)
return
raise ExecutorError(