box / box/ClusterRunner

Build runner tries to cancel failed builds

Open
#225 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
184
Forks
41
PR merge metrics
No merged PRs in 30d

Description

Example output:

```
...
42 of 44 subjobs are complete (95.5%).
Build is finished. (Build id: 1)
Build 1 result was FAILURE
These atoms had non-zero exit codes (failures):
...
Executing teardown callback: >
Cancelling build 1
```

Canceling a finished build is a no-op, so there aren't any negative effects except for the confusing output above.

The cause of this bug is that in build_runner.py we add a teardown callback to cancel the build if something goes wrong. But the teardown callback persists even if the build finishes and it ends up getting triggered at the very end in build_subcommand.py when we call `sys.exit(1)`. (`sys.exit` actually just raises a special exception that the unhandled exception handler interprets as a signal to run teardown callbacks.)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in build_runner.py, focusing on the teardown callback that invokes BuildRunner._cancel_build, then trace how build_subcommand.py handles sys.exit(1). Reproduce a failed build and confirm that a completed build no longer triggers cancellation output or the cancellation callback.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.