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

Removed errant proc.kill() #2103

Merged
merged 3 commits into from
Nov 22, 2024
Merged

Removed errant proc.kill() #2103

merged 3 commits into from
Nov 22, 2024

Conversation

rben01
Copy link
Contributor

@rben01 rben01 commented Nov 21, 2024

In #2098 I tried killing the process. It turns out that doing this before waiting leads to out of order IO, leading to IO errors when Bincode tries to deserialize. It also turns out that killing isn't even necessary; waiting is sufficient.

So this PR removes that kill line, getting rid of the IO errors introduced in #2098.

Also Added finish to benchmark_diagnostics as well (should have been there all along). Thought: do we want to just impl Drop for TestHarness? This might make the panicking situation tricky (generally, you shouldn't panic in drop), whereas explicitly calling harness.finish(), while possible to forget, makes handling panics just work.

Copy link
Contributor

github-actions bot commented Nov 21, 2024

Thought: do we want to just `impl Drop for TestHarness`? This might make the panicking situation tricky, whereas explicitly calling `harness.finish()`, while possible to forget, makes handling panics just work.
@jneem
Copy link
Member

jneem commented Nov 22, 2024

Thought: do we want to just impl Drop for TestHarness?

I don't have a strong opinion. Since this is test code, accidentally aborting due to a panic in drop isn't a big deal. On the other hand, we don't construct TestHarness that often, so remembering to call finish is probably not too hard. So either way is really ok with me.

Ensures shutdown and cleanup so that we can't forget
This is important during benchmarking; Criterion creates thousands of servers, and if we don't shut them down and clean them up, we'll exhaust the system's process pool
@rben01
Copy link
Contributor Author

rben01 commented Nov 22, 2024

Since I did in fact forget to call finish once, it's probably best to impl Drop for Server, bundling shutting down and waiting into it, so that they can't be forgotten. I don't expect the errors to actually ever be thrown, so panicking should be rare. And shutdown was never actually used anywhere, so I just moved it right into drop.

@yannham yannham added this pull request to the merge queue Nov 22, 2024
Merged via the queue into tweag:master with commit 41a3e64 Nov 22, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

3 participants