Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report errors from subprocesses #957

Open
jugglinmike opened this issue Mar 12, 2024 · 0 comments
Open

Report errors from subprocesses #957

jugglinmike opened this issue Mar 12, 2024 · 0 comments

Comments

@jugglinmike
Copy link
Contributor

While investigating an issue with this project's "import" script, @howard-e found that a process spawned by the script had crashed. Although this exceptional circumstance should be plainly evident from server logs, Howard could only intuit its occurrence indirectly (that is: by interpreting an error which occurred after the script incorrectly assumed the subprocess had exited cleanly).

Whenever a subprocess is created, the parent should account for the possibility that the child does not complete successfully (even if it is only to report the failure and exit).

A cursory review of the source identifies a number of instances of hazardous subprocess management:

$ git grep spawn '**/*.js'
client/tests/util/getPage.js:const spawn = require('cross-spawn');
client/tests/util/getPage.js:        const server = spawn('yarn', ['workspace', serverOrClient, 'dev'], {
server/scripts/import-tests/index.js:const spawn = require('cross-spawn');
server/scripts/import-tests/index.js:    return spawn
server/scripts/import-tests/index.js:    const installOutput = spawn.sync('npm', ['install'], {
server/scripts/import-tests/index.js:    const buildOutput = spawn.sync('npm', ['run', 'build'], {
server/scripts/import-tests/index.js:    spawn.sync('git', ['clone', ariaAtRepo, gitCloneDirectory]);

...so addressing this problem should begin with a formal audit of the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant