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

fix dbscan waitgroup panic when multiple workers are used #7

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

Conversation

WangZixin67
Copy link

@WangZixin67 WangZixin67 commented Dec 11, 2024

Hi,
I hope this message finds you well.

I'm raising this PR to fix negative wait group value when DBSCAN is utilising multiple threads.

Issue:
The division used to calculate c.f takes the floor of the integer value, which may result in the "nearest" function creating more rangeJobs than the number of workers. Consequently, this causes more calls to WaitGroup.Done than WaitGroup.Add, leading to a negative wait group value.

Solution:
Modify the calculation to use the ceiling of the integer value for c.f.

Thank you for your time.

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.

1 participant