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

sync-request leaves orphaned sync-rpc processes #137

Open
MaddyGuthridge opened this issue Nov 9, 2022 · 0 comments
Open

sync-request leaves orphaned sync-rpc processes #137

MaddyGuthridge opened this issue Nov 9, 2022 · 0 comments

Comments

@MaddyGuthridge
Copy link

A course I teach uses sync-request to allow students to send web requests to test their server. We do this as teaching asynchronous code is too complex for us to cover for beginning students.

However, we have noticed that after their tests finish running, sync-request leaves sync-rpc processes alive. Although these don't have a meaningful impact for individual users, they place a huge amount of strain on our systems when multiplied over 600 students.

Our temporary workaround is to add a posttest script which kills these processes after Jest exits.

pkill -f 'node_modules/sync-rpc/lib/worker.js' > /dev/null 2>&1

However, this is a poor solution, which causes students' code to break in unexpected ways if they also use sync-request in their server if they don't also restart their server between test runs.

Error: nativeNC failed:\n\n

The optimal solution would be for sync-request to properly kill its sync-rpc subprocesses when its host process exits.

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