Skip to content

Commit e219c78

Browse files
sokcevicGLUCI
authored andcommitted
forall: Fix returning results early
rc should be returned only after all results are processed. [email protected] Bug: b/376454189 Change-Id: I8200b9954240dd3e8e9f2ab82494779a3cb38627 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/440901 Tested-by: Josip Sokcevic <[email protected]> Commit-Queue: Josip Sokcevic <[email protected]> Reviewed-by: Joanna Wang <[email protected]>
1 parent f9f4df6 commit e219c78

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

subcmds/forall.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def _ProcessResults(_pool, _output, results):
279279
rc = rc or r
280280
if r != 0 and opt.abort_on_errors:
281281
raise Exception("Aborting due to previous error")
282-
return rc
282+
return rc
283283

284284
try:
285285
config = self.manifest.manifestProject.config
@@ -298,15 +298,15 @@ def _ProcessResults(_pool, _output, results):
298298
)
299299
except (KeyboardInterrupt, WorkerKeyboardInterrupt):
300300
# Catch KeyboardInterrupt raised inside and outside of workers
301-
rc = rc or errno.EINTR
301+
rc = errno.EINTR
302302
except Exception as e:
303303
# Catch any other exceptions raised
304304
logger.error(
305305
"forall: unhandled error, terminating the pool: %s: %s",
306306
type(e).__name__,
307307
e,
308308
)
309-
rc = rc or getattr(e, "errno", 1)
309+
rc = getattr(e, "errno", 1)
310310
if rc != 0:
311311
sys.exit(rc)
312312

0 commit comments

Comments
 (0)