Make subprocess command logging atomic
- Dominant language
- Python
- Stars
- 3.3k
- Forks
- 549
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 40
Description
### What is the problem or limitation you are having?
Each time a subprocess command is executed, `Subprocess` logs its command line, environment, return code, stdout/stderr, etc. However, these operations are independently serial; therefore, when subprocess calls are executed concurrently, the logging of different commands can become intermingled and undecipherable.
This is currently a problem for macOS code signing as all of the files are concurrently signed by a threadpool.
Example log file: https://github.com/user-attachments/files/16044976/briefcase.2024_06_30-10_13_00.package.log
### Describe the solution you'd like
Convert all of the subprocess command logging to be atomic such that each block of logging for a specific command is guaranteed to be on consecutive lines in the log.
### Describe alternatives you've considered
Omit concurrent subprocess execution.
### Additional context
_No response_
Contributor guide
Research direction
Start by locating the Subprocess implementation and its command, environment, return-code, stdout, and stderr logging. Reproduce concurrent subprocess execution, especially the macOS code-signing threadpool case, and verify that each command's complete log block remains on consecutive lines without interleaving.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100