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

[Enhancement] An Improvement Idea for SyncPutQueuePolicy #1584

Open
3 tasks done
qy-liuhuo opened this issue Dec 17, 2024 · 0 comments
Open
3 tasks done

[Enhancement] An Improvement Idea for SyncPutQueuePolicy #1584

qy-liuhuo opened this issue Dec 17, 2024 · 0 comments

Comments

@qy-liuhuo
Copy link

Search before asking

  • I had searched in the issues and found no similar issues.

Enhancement Request

SyncPutQueuePolicy was proposed in #54. When this policy is used and the thread pool blocking queue is full, the main thread will put the rejected task to the queue in a blocking manner.

However, if the system fails to complete the task in the thread pool in time, the put method will be blocked, which will cause the thread to continue to block and the user request to time out.

Describe the solution you'd like

I think it is better to use the offer method of the blocking queue instead of the put method. In this way, we can prevent infinite blocking by setting a timeout

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant