-
Notifications
You must be signed in to change notification settings - Fork 9
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
chore: update streaming handler #196
Conversation
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
WalkthroughThe recent update introduces a new control flow for server and worker pool management. The server's shutdown process has been replaced with a close operation, and the worker pool can now be stopped using a select statement. Error handling has been refined to continue loop execution after a response error, and channel management within the worker pool has been streamlined. Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to filter (5)
- go.mod
- go.sum
- go.work.sum
- tests/go.mod
- tests/go.sum
Files selected for processing (4)
- handler/handler.go (2 hunks)
- servers/fcgi/fcgi.go (2 hunks)
- servers/http11/http.go (4 hunks)
- servers/https/https.go (2 hunks)
Additional comments: 7
servers/fcgi/fcgi.go (1)
- 61-61: The change from
Shutdown
toClose
in theStop
method alters the server shutdown behavior. Ensure that this change is intentional and that the immediate termination of connections is the desired behavior, asClose
does not wait for ongoing requests to finish.servers/http11/http.go (2)
49-52: The timeout settings for
ReadTimeout
,WriteTimeout
,ReadHeaderTimeout
, andIdleTimeout
have been standardized to 5 minutes and 1 hour respectively. Confirm that these values are aligned with the expected load and performance characteristics of the server.105-105: The
Stop
method has been updated to usehttp.Close()
instead ofhttp.Shutdown()
. This change should be carefully reviewed to ensure that it aligns with the desired server shutdown behavior, asClose
will immediately terminate all connections.servers/https/https.go (1)
- 141-141: The
Stop
method has been updated to usehttps.Close()
instead ofhttps.Shutdown(context.Background())
. As with the other server types, ensure that this change is intentional and that the immediate termination of connections is the desired behavior.handler/handler.go (3)
179-182: The addition of the
select
statement with a non-blocking send tostopCh
is a good practice to prevent goroutine leaks. However, ensure that the downstream code is designed to handle this non-blocking behavior correctly.294-297: The
getCh
method has been simplified to directly retrieve a channel from thestopChPool
. Ensure that the pool always contains properly initialized channels to prevent runtime panics.297-297: The
putCh
method now includes a non-blocking receive to ensure the channel is empty before putting it back into the pool. This is a good practice to avoid unexpected behavior due to leftover signals in the channel.
Reason for This PR
ref: roadrunner-server/roadrunner#1830
Description of Changes
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the MIT license.
PR Checklist
[Author TODO: Meet these criteria.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]
git commit -s
).CHANGELOG.md
.Summary by CodeRabbit
Refactor
Bug Fixes
Performance Improvements
Documentation