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

file_single_chunk: use URI::RFC2396_PARSER due to suppress obsoleted message #4774

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

Watson1978
Copy link
Contributor

@Watson1978 Watson1978 commented Jan 20, 2025

Which issue(s) this PR fixes:
Fixes #

What this PR does / why we need it:
Since Ruby 3.4.0, URI::DEFAULT_PARSER causes warning of warning: URI::RFC3986_PARSER.unescape is obsolete. Use URI::RFC2396_PARSER.unescape explicitly..
Ref. ruby/uri@9997c1a

  • reproduce
$ bundle exec ruby -v -w -I"lib" test/plugin/test_buffer_file_single_chunk.rb -v
ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [x86_64-linux]
/home/watson/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/async-2.21.1/lib/async/task.rb:298: warning: assigned but unused variable - error
/home/watson/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/async-pool-0.10.2/lib/async/pool/controller.rb:332: warning: assigned but unused variable - error
/home/watson/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/traces-0.14.1/lib/traces/config.rb:43: warning: assigned but unused variable - error
/home/watson/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/async-http-0.86.0/lib/async/http/protocol/http1/server.rb:55: warning: assigned but unused variable - error
/home/watson/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/async-http-0.86.0/lib/async/http/protocol/http2/connection.rb:98: warning: assigned but unused variable - ignored_error
/home/watson/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/protocol-http-0.47.1/lib/protocol/http/body/stream.rb:263: warning: assigned but unused variable - buffer
/home/watson/src/fluentd/lib/fluent/plugin_helper.rb:46: warning: method redefined; discarding old inherited
/home/watson/src/fluentd/lib/fluent/plugin_helper.rb:46: warning: previous definition of inherited was here
Loaded suite test/plugin/test_buffer_file_single_chunk
Started
BufferFileSingleChunkTest: 
  chunk with file for enqueued chunk: 
    test: can load as queued chunk (read only) with metadata:																		/home/watson/src/fluentd/lib/fluent/plugin/buffer/file_single_chunk.rb:250: warning: URI::RFC3986_PARSER.unescape is obsolete. Use URI::RFC2396_PARSER.unescape explicitly.
.: (0.001127)
  chunk with file for staged chunk: 
    test: #file_rename can rename chunk files even in windows, and call callback with file size:													/home/watson/src/fluentd/lib/fluent/plugin/buffer/file_single_chunk.rb:250: warning: URI::RFC3986_PARSER.unescape is obsolete. Use URI::RFC2396_PARSER.unescape explicitly.
.: (0.000559)
    test: can be enqueued:																						/home/watson/src/fluentd/lib/fluent/plugin/buffer/file_single_chunk.rb:250: warning: URI::RFC3986_PARSER.unescape is obsolete. Use URI::RFC2396_PARSER.unescape explicitly.
.: (0.000361)
    test: can load as staged chunk from file with metadata:																		/home/watson/src/fluentd/lib/fluent/plugin/buffer/file_single_chunk.rb:250: warning: URI::RFC3986_PARSER.unescape is obsolete. Use URI::RFC2396_PARSER.unescape explicitly.
.: (0.000307)
  chunk with queued chunk file: 
    test: can load as queued chunk:																					/home/watson/src/fluentd/lib/fluent/plugin/buffer/file_single_chunk.rb:250: warning: URI::RFC3986_PARSER.unescape is obsolete. Use URI::RFC2396_PARSER.unescape explicitly.
.: (0.000431)

...(snip)...

This patch will use URI::RFC2396_PARSER instead due to suppress above warning.

Docs Changes:

Release Note:

@Watson1978 Watson1978 requested a review from daipom January 20, 2025 03:20
@daipom
Copy link
Contributor

daipom commented Jan 20, 2025

Thanks!
I have some concerns that this does not work on some Ruby versions.

In the following issue, URI::RFC2396_PARSER was provided to Ruby 3.2 and 3.3.

So, this works well on the latest 3.2.x and 3.3.x.
However, some old patch versions don't have URI::RFC2396_PARSER.
For example, this would not work on Ruby 3.2.0, right?

I would like to hear from other maintainers on this point.

@daipom daipom added the pending To be done in the future label Jan 20, 2025
@cosmo0920

This comment was marked as outdated.

@daipom daipom added this to the v1.19.0 milestone Jan 28, 2025
@daipom daipom removed the pending To be done in the future label Jan 29, 2025
Copy link
Contributor

@daipom daipom left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

@daipom daipom merged commit eaca8db into fluent:master Jan 29, 2025
9 of 10 checks passed
@Watson1978 Watson1978 deleted the file_single_chunk branch January 29, 2025 01:31
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.

3 participants