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

bug: workerStack's binarySearch #278

Merged
merged 1 commit into from
Jun 8, 2023
Merged

bug: workerStack's binarySearch #278

merged 1 commit into from
Jun 8, 2023

Conversation

callthingsoff
Copy link
Contributor

Avoid overflow when computing mid.

Avoid overflow when computing mid.
Copy link
Owner

@panjf2000 panjf2000 left a comment

Choose a reason for hiding this comment

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

Well, I didn't want to overthink the possibility of this calculation overflowing the int type when we introduced this implemention of binary search, because if that's case, the amount of goroutines in ants would be too significant and it's meaningless to use a goroutine pool like ants. But I guess it's also OK for ants to be finicky here.

panjf2000

This comment was marked as duplicate.

@panjf2000 panjf2000 added bug Something isn't working enhancement New feature or request optimization needs fix labels Jun 8, 2023
@codecov
Copy link

codecov bot commented Jun 8, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01 ⚠️

Comparison is base (9fdd99a) 92.45% compared to head (70eb6ad) 92.44%.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #278      +/-   ##
==========================================
- Coverage   92.45%   92.44%   -0.01%     
==========================================
  Files           9        9              
  Lines         769      768       -1     
==========================================
- Hits          711      710       -1     
  Misses         44       44              
  Partials       14       14              
Flag Coverage Δ
unittests 92.44% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
worker_stack.go 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@panjf2000 panjf2000 merged commit 67b3a7a into panjf2000:dev Jun 8, 2023
@callthingsoff callthingsoff deleted the fix_binary_search_overflow branch June 8, 2023 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request needs fix optimization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants