Skip to content

Conversation

wdsjk
Copy link

@wdsjk wdsjk commented Sep 27, 2025

Fixes: #8596

Added cancellation by context in benchmark/client instead of custom channel approach. Not sure about returning ctx.Err() (as mentioned in the original issue under point 4), so please review

RELEASE NOTES: None

Copy link

linux-foundation-easycla bot commented Sep 27, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link

codecov bot commented Sep 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.04%. Comparing base (9ff80a7) to head (87d80e9).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8614      +/-   ##
==========================================
+ Coverage   81.96%   82.04%   +0.07%     
==========================================
  Files         415      415              
  Lines       40694    40694              
==========================================
+ Hits        33355    33387      +32     
+ Misses       5950     5946       -4     
+ Partials     1389     1361      -28     

see 32 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wdsjk wdsjk marked this pull request as draft September 27, 2025 17:22
@wdsjk wdsjk marked this pull request as ready for review September 27, 2025 17:30
@wdsjk
Copy link
Author

wdsjk commented Sep 27, 2025

Could you please add "Type: Internal Cleanup" label? Thanks

@Pranjali-2501 Pranjali-2501 added the Type: Internal Cleanup Refactors, etc label Sep 30, 2025
@Pranjali-2501 Pranjali-2501 self-requested a review September 30, 2025 06:53
@Pranjali-2501 Pranjali-2501 self-assigned this Sep 30, 2025
@Pranjali-2501 Pranjali-2501 added this to the 1.77 Release milestone Sep 30, 2025
select {
case <-bc.stop:
if bc.ctx.Err() != nil {
return
Copy link
Contributor

@Pranjali-2501 Pranjali-2501 Oct 7, 2025

Choose a reason for hiding this comment

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

Can we change it to return bc.ctx.Err() and change function unaryLoop to return error?

Copy link
Author

Choose a reason for hiding this comment

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

I believe we can, but error is happening inside a goroutine and I'm not quite sure how to implement handling. Could you suggest an approach?

if err := benchmark.DoUnaryCall(client, reqSize, respSize); err != nil {
if err := benchmark.DoUnaryCallWithContext(bc.ctx, client, reqSize, respSize); err != nil {
if status.Code(err) == codes.Canceled || errors.Is(err, context.Canceled) {
return
Copy link
Contributor

Choose a reason for hiding this comment

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

Any specific reason for not changing the return type of unaryLoop to return ctx.Err()?

@arjan-bal arjan-bal assigned arjan-bal and unassigned wdsjk Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

benchmark/client: Use context for cancellation
3 participants