-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
http_server: Ready to support Async 2.0 gem #3842
Conversation
Hmm, can't build io-event on Windows: https://github.com/fluent/fluentd/runs/7645045887?check_suite_focus=true
|
I'm seeing.. |
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.
LGTM.
Hmm, this log is not outputted. I don't know why...
In master, when launching Fluentd with this config, the log is outputted using ConsoleAdapter.
|
https://github.com/socketry/async-io/blob/v1.34.3/lib/async/io/socket.rb#L157 At this point, somehow I'm thinking about the possibility that the logger is not passed to the child task correctly. |
It seems that fluentd/lib/fluent/plugin_helper/http_server.rb Lines 74 to 76 in bf7498d
|
https://github.com/socketry/console/blob/main/lib/console.rb#L13-L19 |
We may have to do something like this... --- a/lib/fluent/plugin_helper/http_server/server.rb
+++ b/lib/fluent/plugin_helper/http_server/server.rb
@@ -40,7 +40,6 @@ module Fluent
@uri = URI("#{scheme}://#{@addr}:#{@port}").to_s
@router = Router.new(default_app)
@server_task = nil
- Console.logger = Fluent::Log::ConsoleAdapter.wrap(@logger)
opts = if tls_context
{ ssl_context: tls_context }
@@ -55,10 +54,12 @@ module Fluent
end
def start(notify = nil)
+ Console.logger = Fluent::Log::ConsoleAdapter.wrap(@logger)
@logger.debug("Start async HTTP server listening #{@uri}")
Async do |task|
@server_task = task.async do
+ Console.logger = Fluent::Log::ConsoleAdapter.wrap(@logger)
@server.run
end
if notify |
Thanks for checking it. |
Note: We have to consider the possibility of |
Signed-off-by: Takuro Ashie <[email protected]>
Because dependent io-event (v1.0.9) can't build on Windows. Signed-off-by: Takuro Ashie <[email protected]>
Signed-off-by: Takuro Ashie <[email protected]>
Signed-off-by: Takuro Ashie <[email protected]>
Hmm, GitHub "update branch" feature is not what I want. rebased manually. |
It should be "Update with rebase". |
It looks like as of v0.65.0 the |
Thanks notifying it, we'll check it. |
This pull request isn't ready for v1.17, we postpone merging this. |
This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 7 days |
Seems that currently
|
Async 2.x supports Ruby 3.1 or later only. |
Hmm, io-event gem still have a problem on windows platform.
https://github.com/Watson1978/fluentd/actions/runs/10483331006/job/29035871921 |
We'll continue this work in #4619 |
Which issue(s) this PR fixes:
Fixes #
What this PR does / why we need it:
http_server
plugin helper doesn't work with Async 2.x gem due to using obsolete usage.This PR updates it to follow current documented way:
https://github.com/socketry/async-http/blob/0a65acd7cf7486e1877f0da86580e1692cd8207b/readme.md#usage
It's applicable both Async 2.x & Async 1.x.
But this PR still stay on Async 1.x because io-event gem which is required by Async 2.x can't build on Windows.
Docs Changes:
None
Release Note:
Same with the title