Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package rubygem-fluentd for openSUSE:Factory 
checked in at 2022-02-24 18:20:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-fluentd (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-fluentd.new.1958 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-fluentd"

Thu Feb 24 18:20:16 2022 rev:19 rq:956117 version:1.14.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-fluentd/rubygem-fluentd.changes  
2022-02-02 22:45:02.398057113 +0100
+++ 
/work/SRC/openSUSE:Factory/.rubygem-fluentd.new.1958/rubygem-fluentd.changes    
    2022-02-24 18:23:32.454657003 +0100
@@ -1,0 +2,31 @@
+Tue Feb 15 07:28:19 UTC 2022 - Stephan Kulow <co...@suse.com>
+
+updated to version 1.14.5
+ see installed CHANGELOG.md
+
+  # v1.14.5
+  
+  ## Release v1.14.5 - 2022/02/09
+  
+  ### Enhancement
+  
+  * Add support for "application/x-ndjson" to `in_http`
+    https://github.com/fluent/fluentd/pull/3616
+  * Add support for ucrt binary for Windows
+    https://github.com/fluent/fluentd/pull/3613
+  
+  ### Bug fixes
+  
+  * Don't retry when `retry_max_times == 0`
+    https://github.com/fluent/fluentd/pull/3608
+  * Fix hang-up issue during TLS handshake in `out_forward`
+    https://github.com/fluent/fluentd/pull/3601
+  * Bump up required ServerEngine to v2.2.5
+    https://github.com/fluent/fluentd/pull/3599
+  * Fix "invalid byte sequence is replaced" warning on Kubernetes
+    https://github.com/fluent/fluentd/pull/3596
+  * Fix "ArgumentError: unknown keyword: :logger" on Windows with Ruby 3.1
+    https://github.com/fluent/fluentd/pull/3592
+  
+
+-------------------------------------------------------------------

Old:
----
  fluentd-1.14.4.gem

New:
----
  fluentd-1.14.5.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-fluentd.spec ++++++
--- /var/tmp/diff_new_pack.mT2Oiz/_old  2022-02-24 18:23:32.950656909 +0100
+++ /var/tmp/diff_new_pack.mT2Oiz/_new  2022-02-24 18:23:32.954656908 +0100
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-fluentd
-Version:        1.14.4
+Version:        1.14.5
 Release:        0
 %define mod_name fluentd
 %define mod_full_name %{mod_name}-%{version}

++++++ fluentd-1.14.4.gem -> fluentd-1.14.5.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md    2022-01-06 06:19:35.000000000 +0100
+++ new/CHANGELOG.md    2022-02-09 04:08:36.000000000 +0100
@@ -1,3 +1,27 @@
+# v1.14.5
+
+## Release v1.14.5 - 2022/02/09
+
+### Enhancement
+
+* Add support for "application/x-ndjson" to `in_http`
+  https://github.com/fluent/fluentd/pull/3616
+* Add support for ucrt binary for Windows
+  https://github.com/fluent/fluentd/pull/3613
+
+### Bug fixes
+
+* Don't retry when `retry_max_times == 0`
+  https://github.com/fluent/fluentd/pull/3608
+* Fix hang-up issue during TLS handshake in `out_forward`
+  https://github.com/fluent/fluentd/pull/3601
+* Bump up required ServerEngine to v2.2.5
+  https://github.com/fluent/fluentd/pull/3599
+* Fix "invalid byte sequence is replaced" warning on Kubernetes
+  https://github.com/fluent/fluentd/pull/3596
+* Fix "ArgumentError: unknown keyword: :logger" on Windows with Ruby 3.1
+  https://github.com/fluent/fluentd/pull/3592
+
 # v1.14.4
 
 ## Release v1.14.4 - 2022/01/06
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md       2022-01-06 06:19:35.000000000 +0100
+++ new/README.md       2022-02-09 04:08:36.000000000 +0100
@@ -1,17 +1,12 @@
 Fluentd: Open-Source Log Collector
 ===================================
-GitHub Actions:
 
 [![Testing on 
Ubuntu](https://github.com/fluent/fluentd/actions/workflows/linux-test.yaml/badge.svg?branch=master)](https://github.com/fluent/fluentd/actions/workflows/linux-test.yaml)
 [![Testing on 
Windows](https://github.com/fluent/fluentd/actions/workflows/windows-test.yaml/badge.svg?branch=master)](https://github.com/fluent/fluentd/actions/workflows/windows-test.yaml)
 [![Testing on 
macOS](https://github.com/fluent/fluentd/actions/workflows/macos-test.yaml/badge.svg?branch=master)](https://github.com/fluent/fluentd/actions/workflows/macos-test.yaml)
+[![Testing on 
Arm64](https://cloud.drone.io/api/badges/fluent/fluentd/status.svg?branch=master)](https://cloud.drone.io/fluent/fluentd)
 [![Code 
Climate](https://codeclimate.com/github/fluent/fluentd/badges/gpa.svg)](https://codeclimate.com/github/fluent/fluentd)
 [![CII Best 
Practices](https://bestpractices.coreinfrastructure.org/projects/1189/badge)](https://bestpractices.coreinfrastructure.org/projects/1189)
-[![FOSSA 
Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Ffluent%2Ffluentd.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Ffluent%2Ffluentd?ref=badge_shield)
-
-Drone CI for Arm64:
-
-[![pipeline 
status](https://cloud.drone.io/api/badges/fluent/fluentd/status.svg?branch=master)](https://cloud.drone.io/fluent/fluentd)
 
 [Fluentd](https://www.fluentd.org/) collects events from various data sources 
and writes them to files, RDBMS, NoSQL, IaaS, SaaS, Hadoop and so on. Fluentd 
helps you unify your logging infrastructure (Learn more about the [Unified 
Logging Layer](https://www.fluentd.org/blog/unified-logging-layer)).
 
@@ -19,16 +14,6 @@
 <img src="https://www.fluentd.org/images/fluentd-architecture.png"; 
width="500px"/>
 </p>
 
-An event consists of *tag*, *time* and *record*. Tag is a string separated 
with '.' (e.g. myapp.access). It is used to categorize events. Time is a UNIX 
time recorded at occurrence of an event. Record is a JSON object.
-
-## Example Use Cases
-
-Use Case | Description | Diagram
--------- | ------------|:---------:
-Centralizing Apache/Nginx Server Logs | Fluentd can be used to tail 
access/error logs and transport them reliably to remote systems. | <img 
src="https://www.fluentd.org/images/recipes/elasticsearch-s3-fluentd.png"; 
height="150"/>
-Syslog Alerting | Fluentd can "grep" for events and send out alerts. | <img 
src="https://www.fluentd.org/images/syslog-fluentd-alert.png"; height="100"/>
-Mobile/Web Application Logging | Fluentd can function as middleware to enable 
asynchronous, scalable logging for user action events. | <img 
src="https://www.fluentd.org/images/datasources/asynchronous_logging.png"; 
height="150"/>
-
 ## Quick Start
 
     $ gem install fluentd
@@ -66,12 +51,6 @@
     $ bundle exec rake test TEST=test/test_specified_path.rb
     $ bundle exec rake test TEST=test/test_*.rb
 
-## Fluentd UI: Admin GUI
-
-[Fluentd UI](https://github.com/fluent/fluentd-ui) is a graphical user 
interface to start/stop/configure Fluentd.
-
-<p align="center"><img width="500" 
src="https://www.fluentd.org/images/blog/fluentd-ui.gif"/></p>
-
 ## More Information
 
 - Website: https://www.fluentd.org/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Rakefile new/Rakefile
--- old/Rakefile        2022-01-06 06:19:35.000000000 +0100
+++ new/Rakefile        2022-02-09 04:08:36.000000000 +0100
@@ -14,7 +14,7 @@
   desc 'Build gems for all platforms'
   task :all do
     Bundler.with_clean_env do
-      %w[ruby x86-mingw32 x64-mingw32].each do |name|
+      %w[ruby x86-mingw32 x64-mingw32 x64-mingw-ucrt].each do |name|
         ENV['GEM_BUILD_FAKE_PLATFORM'] = name
         Rake::Task["build"].execute
       end
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluentd.gemspec new/fluentd.gemspec
--- old/fluentd.gemspec 2022-01-06 06:19:35.000000000 +0100
+++ new/fluentd.gemspec 2022-02-09 04:08:36.000000000 +0100
@@ -22,7 +22,7 @@
   gem.add_runtime_dependency("msgpack", [">= 1.3.1", "< 2.0.0"])
   gem.add_runtime_dependency("yajl-ruby", ["~> 1.0"])
   gem.add_runtime_dependency("cool.io", [">= 1.4.5", "< 2.0.0"])
-  gem.add_runtime_dependency("serverengine", [">= 2.2.2", "< 3.0.0"])
+  gem.add_runtime_dependency("serverengine", [">= 2.2.5", "< 3.0.0"])
   gem.add_runtime_dependency("http_parser.rb", [">= 0.5.1", "< 0.9.0"])
   gem.add_runtime_dependency("sigdump", ["~> 0.2.2"])
   gem.add_runtime_dependency("tzinfo", [">= 1.0", "< 3.0"])
@@ -51,5 +51,6 @@
   gem.add_development_dependency("test-unit", ["~> 3.3"])
   gem.add_development_dependency("test-unit-rr", ["~> 1.0"])
   gem.add_development_dependency("oj", [">= 2.14", "< 4"])
+  gem.add_development_dependency("async", "~> 1.23")
   gem.add_development_dependency("async-http", ">= 0.50.0")
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/fluent/config/error.rb 
new/lib/fluent/config/error.rb
--- old/lib/fluent/config/error.rb      2022-01-06 06:19:35.000000000 +0100
+++ new/lib/fluent/config/error.rb      2022-02-09 04:08:36.000000000 +0100
@@ -29,4 +29,16 @@
 
   class SetDefault < Exception
   end
+
+  class NotFoundPluginError < ConfigError
+    attr_reader :type, :kind
+
+    def initialize(msg, type: nil, kind: nil)
+      @msg = msg
+      @type = type
+      @kind = kind
+
+      super(msg)
+    end
+  end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/fluent/plugin/base.rb 
new/lib/fluent/plugin/base.rb
--- old/lib/fluent/plugin/base.rb       2022-01-06 06:19:35.000000000 +0100
+++ new/lib/fluent/plugin/base.rb       2022-02-09 04:08:36.000000000 +0100
@@ -72,8 +72,8 @@
 
       def string_safe_encoding(str)
         unless str.valid_encoding?
-          log.info "invalid byte sequence is replaced in `#{str}`" if 
self.respond_to?(:log)
           str = str.scrub('?')
+          log.info "invalid byte sequence is replaced in `#{str}`" if 
self.respond_to?(:log)
         end
         yield str
       end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/fluent/plugin/in_http.rb 
new/lib/fluent/plugin/in_http.rb
--- old/lib/fluent/plugin/in_http.rb    2022-01-06 06:19:35.000000000 +0100
+++ new/lib/fluent/plugin/in_http.rb    2022-02-09 04:08:36.000000000 +0100
@@ -314,8 +314,16 @@
         @parser_json.parse(js) do |_time, record|
           return nil, record
         end
+      elsif ndjson = params['ndjson']
+        events = []
+        ndjson.split(/\r?\n/).each do |js|
+          @parser_json.parse(js) do |_time, record|
+            events.push(record)
+          end
+        end
+        return nil, events
       else
-        raise "'json' or 'msgpack' parameter is required"
+        raise "'json', 'ndjson' or 'msgpack' parameter is required"
       end
     end
 
@@ -567,6 +575,8 @@
           params['json'] = @body
         elsif @content_type =~ /^application\/msgpack/
           params['msgpack'] = @body
+        elsif @content_type =~ /^application\/x-ndjson/
+          params['ndjson'] = @body
         end
         path_info = uri.path
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/fluent/plugin/output.rb 
new/lib/fluent/plugin/output.rb
--- old/lib/fluent/plugin/output.rb     2022-01-06 06:19:35.000000000 +0100
+++ new/lib/fluent/plugin/output.rb     2022-02-09 04:08:36.000000000 +0100
@@ -1275,11 +1275,15 @@
 
           unless @retry
             @retry = retry_state(@buffer_config.retry_randomize)
-            if error
-              log.warn "failed to flush the buffer.", retry_times: 
@retry.steps, next_retry_time: @retry.next_time.round, chunk: chunk_id_hex, 
error: error
-              log.warn_backtrace error.backtrace
+            if @retry.limit?
+              # @retry_max_times == 0, fail imediately by the following block
+            else
+              if error
+                log.warn "failed to flush the buffer.", retry_times: 
@retry.steps, next_retry_time: @retry.next_time.round, chunk: chunk_id_hex, 
error: error
+                log.warn_backtrace error.backtrace
+              end
+              return
             end
-            return
           end
 
           # @retry exists
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/fluent/plugin_helper/socket.rb 
new/lib/fluent/plugin_helper/socket.rb
--- old/lib/fluent/plugin_helper/socket.rb      2022-01-06 06:19:35.000000000 
+0100
+++ new/lib/fluent/plugin_helper/socket.rb      2022-02-09 04:08:36.000000000 
+0100
@@ -96,6 +96,7 @@
           enable_system_cert_store: true, allow_self_signed_cert: false, 
cert_paths: nil,
           cert_path: nil, private_key_path: nil, private_key_passphrase: nil,
           cert_thumbprint: nil, cert_logical_store_name: nil, 
cert_use_enterprise_store: true,
+          connect_timeout: nil,
           **kwargs, &block)
 
         host_is_ipaddress = IPAddr.new(host) rescue false
@@ -158,13 +159,23 @@
         end
         Fluent::TLS.set_version_to_context(context, version, min_version, 
max_version)
 
-        tcpsock = socket_create_tcp(host, port, **kwargs)
+        tcpsock = socket_create_tcp(host, port, connect_timeout: 
connect_timeout, **kwargs)
         sock = WrappedSocket::TLS.new(tcpsock, context)
         sock.sync_close = true
         sock.hostname = fqdn if verify_fqdn && fqdn && 
sock.respond_to?(:hostname=)
 
         log.trace "entering TLS handshake"
-        sock.connect
+        if connect_timeout
+          begin
+            Timeout.timeout(connect_timeout) { sock.connect }
+          rescue Timeout::Error
+            log.warn "timeout while connecting tls session", host: host
+            sock.close rescue nil
+            raise
+          end
+        else
+          sock.connect
+        end
 
         begin
           if verify_fqdn
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/fluent/registry.rb new/lib/fluent/registry.rb
--- old/lib/fluent/registry.rb  2022-01-06 06:19:35.000000000 +0100
+++ new/lib/fluent/registry.rb  2022-02-09 04:08:36.000000000 +0100
@@ -45,7 +45,8 @@
       if value = @map[type]
         return value
       end
-      raise ConfigError, "Unknown #{@kind} plugin '#{type}'. Run 'gem search 
-rd fluent-plugin' to find plugins"  # TODO error class
+      raise NotFoundPluginError.new("Unknown #{@kind} plugin '#{type}'. Run 
'gem search -rd fluent-plugin' to find plugins",
+                                    kind: @kind, type: type)
     end
 
     def reverse_lookup(value)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/fluent/version.rb new/lib/fluent/version.rb
--- old/lib/fluent/version.rb   2022-01-06 06:19:35.000000000 +0100
+++ new/lib/fluent/version.rb   2022-02-09 04:08:36.000000000 +0100
@@ -16,6 +16,6 @@
 
 module Fluent
 
-  VERSION = '1.14.4'
+  VERSION = '1.14.5'
 
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2022-01-06 06:19:35.000000000 +0100
+++ new/metadata        2022-02-09 04:08:36.000000000 +0100
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: fluentd
 version: !ruby/object:Gem::Version
-  version: 1.14.4
+  version: 1.14.5
 platform: ruby
 authors:
 - Sadayuki Furuhashi
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2022-01-06 00:00:00.000000000 Z
+date: 2022-02-09 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: bundler
@@ -84,7 +84,7 @@
     requirements:
     - - ">="
       - !ruby/object:Gem::Version
-        version: 2.2.2
+        version: 2.2.5
     - - "<"
       - !ruby/object:Gem::Version
         version: 3.0.0
@@ -94,7 +94,7 @@
     requirements:
     - - ">="
       - !ruby/object:Gem::Version
-        version: 2.2.2
+        version: 2.2.5
     - - "<"
       - !ruby/object:Gem::Version
         version: 3.0.0
@@ -339,6 +339,20 @@
       - !ruby/object:Gem::Version
         version: '4'
 - !ruby/object:Gem::Dependency
+  name: async
+  requirement: !ruby/object:Gem::Requirement
+    requirements:
+    - - "~>"
+      - !ruby/object:Gem::Version
+        version: '1.23'
+  type: :development
+  prerelease: false
+  version_requirements: !ruby/object:Gem::Requirement
+    requirements:
+    - - "~>"
+      - !ruby/object:Gem::Version
+        version: '1.23'
+- !ruby/object:Gem::Dependency
   name: async-http
   requirement: !ruby/object:Gem::Requirement
     requirements:
@@ -945,7 +959,7 @@
     - !ruby/object:Gem::Version
       version: '0'
 requirements: []
-rubygems_version: 3.1.2
+rubygems_version: 3.3.3
 signing_key: 
 specification_version: 4
 summary: Fluentd event collector
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/compat/test_parser.rb 
new/test/compat/test_parser.rb
--- old/test/compat/test_parser.rb      2022-01-06 06:19:35.000000000 +0100
+++ new/test/compat/test_parser.rb      2022-02-09 04:08:36.000000000 +0100
@@ -22,7 +22,7 @@
   Fluent::TextParser.register_template('multi_event_test', Proc.new { 
MultiEventTestParser.new })
 
   def test_lookup_unknown_format
-    assert_raise Fluent::ConfigError do
+    assert_raise Fluent::NotFoundPluginError do
       Fluent::Plugin.new_parser('unknown')
     end
   end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/plugin/test_filter_parser.rb 
new/test/plugin/test_filter_parser.rb
--- old/test/plugin/test_filter_parser.rb       2022-01-06 06:19:35.000000000 
+0100
+++ new/test/plugin/test_filter_parser.rb       2022-02-09 04:08:36.000000000 
+0100
@@ -46,7 +46,7 @@
     assert_raise(Fluent::ConfigError) {
       create_driver('')
     }
-    assert_raise(Fluent::ConfigError) {
+    assert_raise(Fluent::NotFoundPluginError) {
       create_driver %[
         key_name foo
         <parse>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/plugin/test_filter_stdout.rb 
new/test/plugin/test_filter_stdout.rb
--- old/test/plugin/test_filter_stdout.rb       2022-01-06 06:19:35.000000000 
+0100
+++ new/test/plugin/test_filter_stdout.rb       2022-02-09 04:08:36.000000000 
+0100
@@ -63,7 +63,7 @@
       end
 
       def test_invalid_output_type
-        assert_raise(Fluent::ConfigError) do
+        assert_raise(Fluent::NotFoundPluginError) do
           d = create_driver(CONFIG + config_element("", "", { "output_type" => 
"foo" }))
           d.run {}
         end
@@ -139,7 +139,7 @@
       def test_invalid_output_type
         conf = config_element
         conf.elements << config_element("format", "", { "@type" => "stdout", 
"output_type" => "foo" })
-        assert_raise(Fluent::ConfigError) do
+        assert_raise(Fluent::NotFoundPluginError) do
           d = create_driver(conf)
           d.run {}
         end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/plugin/test_in_http.rb 
new/test/plugin/test_in_http.rb
--- old/test/plugin/test_in_http.rb     2022-01-06 06:19:35.000000000 +0100
+++ new/test/plugin/test_in_http.rb     2022-02-09 04:08:36.000000000 +0100
@@ -540,6 +540,29 @@
     assert_equal_event_time time, d.events[1][1]
   end
 
+  def test_application_ndjson
+    d = create_driver
+    events = [
+        ["tag1", 1643935663, "{\"a\":1}\n{\"b\":2}"],
+        ["tag2", 1643935664, "{\"a\":3}\r\n{\"b\":4}"]
+    ]
+
+    expected = [
+        ["tag1", 1643935663, {"a"=>1}],
+        ["tag1", 1643935663, {"b"=>2}],
+        ["tag2", 1643935664, {"a"=>3}],
+        ["tag2", 1643935664, {"b"=>4}]
+    ]
+
+    d.run(expect_records: 1) do
+      events.each do |tag, time, record|
+        res = post("/#{tag}?time=#{time}", record, 
{"Content-Type"=>"application/x-ndjson"})
+        assert_equal("200", res.code)
+      end
+    end
+    assert_equal(expected, d.events)
+  end
+
   def test_msgpack
     d = create_driver
     time = event_time("2011-01-02 13:14:15 UTC")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/plugin/test_out_stdout.rb 
new/test/plugin/test_out_stdout.rb
--- old/test/plugin/test_out_stdout.rb  2022-01-06 06:19:35.000000000 +0100
+++ new/test/plugin/test_out_stdout.rb  2022-02-09 04:08:36.000000000 +0100
@@ -32,7 +32,7 @@
       assert_kind_of Fluent::Plugin::StdoutFormatter, d.instance.formatter
       assert_equal 'hash', d.instance.formatter.output_type
 
-      assert_raise(Fluent::ConfigError) do
+      assert_raise(Fluent::NotFoundPluginError) do
         d = create_driver(CONFIG + "\noutput_type foo")
       end
     end
@@ -126,7 +126,7 @@
       assert_kind_of Fluent::Plugin::StdoutFormatter, d.instance.formatter
       assert_equal 'hash', d.instance.formatter.output_type
 
-      assert_raise(Fluent::ConfigError) do
+      assert_raise(Fluent::NotFoundPluginError) do
         create_driver(config_element("ROOT", "", {"output_type" => "foo"}, 
[config_element("buffer")]))
       end
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/plugin/test_output_as_buffered_retries.rb 
new/test/plugin/test_output_as_buffered_retries.rb
--- old/test/plugin/test_output_as_buffered_retries.rb  2022-01-06 
06:19:35.000000000 +0100
+++ new/test/plugin/test_output_as_buffered_retries.rb  2022-02-09 
04:08:36.000000000 +0100
@@ -701,6 +701,53 @@
       assert{ @i.buffer.stage.size == 1 }
       assert{ chunks.all?{|c| c.empty? } }
     end
+
+    test 'Do not retry when retry_max_times is 0' do
+      written_tags = []
+
+      chunk_key = 'tag'
+      hash = {
+        'flush_interval' => 1,
+        'flush_thread_burst_interval' => 0.1,
+        'retry_type' => :periodic,
+        'retry_wait' => 1,
+        'retry_randomize' => false,
+        'retry_max_times' => 0,
+        'queued_chunks_limit_size' => 100
+      }
+      
@i.configure(config_element('ROOT','',{},[config_element('buffer',chunk_key,hash)]))
+      @i.register(:prefer_buffered_processing){ true }
+      @i.register(:format){|tag,time,record| [tag,time.to_i,record].to_json + 
"\n" }
+      @i.register(:write){|chunk| written_tags << chunk.metadata.tag; raise 
"yay, your #write must fail" }
+      @i.start
+      @i.after_start
+
+      @i.interrupt_flushes
+
+      now = Time.parse('2016-04-13 18:33:30 -0700')
+      Timecop.freeze( now )
+
+      @i.emit_events("test.tag.1", dummy_event_stream())
+
+      now = Time.parse('2016-04-13 18:33:31 -0700')
+      Timecop.freeze( now )
+
+      @i.emit_events("test.tag.2", dummy_event_stream())
+
+      assert_equal(0, @i.write_count)
+      assert_equal(0, @i.num_errors)
+
+      @i.enqueue_thread_wait
+      @i.flush_thread_wakeup
+      waiting(2){ Thread.pass until @i.write_count == 1 && @i.num_errors == 1 }
+
+      assert(@i.write_count == 1)
+      assert(@i.num_errors == 1)
+      assert(@i.log.out.logs.any?{|l| l.include?("[error]: failed to flush the 
buffer, and hit limit for retries. dropping all chunks in the buffer queue.") 
&& l.include?("retry_times=0") })
+      assert(@i.buffer.queue.size == 0)
+      assert(@i.buffer.stage.size == 1)
+      assert(@i.buffer.queue.all?{|c| c.empty? })
+    end
   end
 
   sub_test_case 'buffered output configured as retry_forever' do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/test_formatter.rb new/test/test_formatter.rb
--- old/test/test_formatter.rb  2022-01-06 06:19:35.000000000 +0100
+++ new/test/test_formatter.rb  2022-02-09 04:08:36.000000000 +0100
@@ -349,7 +349,7 @@
     include FormatterTest
 
     def test_unknown_format
-      assert_raise ConfigError do
+      assert_raise NotFoundPluginError do
         Fluent::Plugin.new_formatter('unknown')
       end
     end

Reply via email to