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

Benchmark should not panic on server close #970

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

caspervonb
Copy link
Collaborator

No description provided.

@caspervonb caspervonb requested a review from Jarema May 17, 2023 09:20
@caspervonb caspervonb force-pushed the benchmark-dont-panic-on-server-close branch from 3b8d39f to 0e17d5b Compare May 17, 2023 09:24
nc.publish("bench".to_string(), msg.clone().into())
.await
.unwrap();
let result =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better directly check for disconnect event on the client and the break the loop, log publish errors (but not panic)?

The benchmark results and report would be cleaner about what happened.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So about printing the error, I don't want to give the impression that the benchmark failed when its expected (albeit racy behavior).

Could instead just loop from 0 to N and still unwrap.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get your point and agree with it.
I'm talking about maybe having more graceful and controlled shutdown of server/clients in benchmarks.

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.

None yet

2 participants