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

common/pool: fix pool abuse #27

Merged
merged 4 commits into from
Sep 11, 2023
Merged

common/pool: fix pool abuse #27

merged 4 commits into from
Sep 11, 2023

Conversation

0xcb9ff9
Copy link

@0xcb9ff9 0xcb9ff9 commented Sep 6, 2023

Description

by default ants.NewPool exist expiry, if submit job wait too long time defer function never call, like this

session.pend.Add(1)
gopool.Submit(func() {
defer session.pend.Done()
defer close(results)

@0xcb9ff9 0xcb9ff9 self-assigned this Sep 6, 2023
@0xcb9ff9 0xcb9ff9 added the bug Something isn't working label Sep 6, 2023
@0xcb9ff9 0xcb9ff9 force-pushed the fix/pool-abuse branch 2 times, most recently from 47724b4 to 691902b Compare September 7, 2023 03:32
Copy link
Collaborator

@DarianShawn DarianShawn left a comment

Choose a reason for hiding this comment

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

Thanks for the great job.
The upstream repo makes something terrible, which we need to fix it step by step. Every small step counts. 🙏

Though I have some questions here.

p2p/dial.go Show resolved Hide resolved
rpc/handler.go Show resolved Hide resolved
common/gopool/pool.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@DarianShawn DarianShawn left a comment

Choose a reason for hiding this comment

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

Excellent. 🙌🏻

@DarianShawn DarianShawn added this pull request to the merge queue Sep 11, 2023
Merged via the queue into dev with commit deb9f2d Sep 11, 2023
@DarianShawn DarianShawn deleted the fix/pool-abuse branch September 11, 2023 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants