fluent-plugin-mongo 1.6.1 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a7505d5d82e1fcf8aa0625efa3bd19f68d7ddd6a9ec8ef75050d5aba1b663a1
4
- data.tar.gz: a0efb583886eb8e8880881d3727dd61e6e2d19c3d2a3d34e4e5d94f0d843b3c3
3
+ metadata.gz: '09b007f64939a3ad6f8476d7845c8932ee122d035902a5ca75c22574fededde0'
4
+ data.tar.gz: 3f18cdb797b67bfadc7f6a26236ab5eb1d47af5b271c9820dacb65b684eacc08
5
5
  SHA512:
6
- metadata.gz: c26d8de1f5c46fbeec69a871fcd26ac83969b58b49990a458f8a25eff830a2b35197267a002d657d3ae751aced56d5637ed1fbc394635e2c59886b4ba2fbe82f
7
- data.tar.gz: 4a33374071ca219f56bb3be9132c1e05d3c2bf1c4018d769fbf2cb7ea61b4eb8f0cabbb6e85baceea9dfcd44c80bc11e7fce75356abe7846fdb6b6a150d082b3
6
+ metadata.gz: 05d1cb4a3bc5c31f8318a25d04f80ded83f57b18e1ab2d4c1e7b43c85c644d7b1db2fd6ed2ea4ca24f3f9f8d3d03cc811566cd73e71f1bcda0a0cd7aee1f74d0
7
+ data.tar.gz: 8d76f125209e1d7bfcf890d445302df48988ea63e4e24e252e60b9fee8ecb38e9f46af0ab6c1faf9d627f8a166617b7b1a4aa772304ad730b583586846b88878
@@ -0,0 +1,72 @@
1
+ name: Bug Report
2
+ description: Create a report with a procedure for reproducing the bug
3
+ labels: "waiting-for-triage"
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ Please check the [README](https://github.com/fluent/fluent-plugin-mongo/blob/master/README.rdoc) first. To help us investigate the problem, please provide the following information.
9
+ - type: textarea
10
+ id: description
11
+ attributes:
12
+ label: Describe the bug
13
+ description: A clear and concise description of what the bug is
14
+ validations:
15
+ required: true
16
+ - type: textarea
17
+ id: reproduce
18
+ attributes:
19
+ label: To Reproduce
20
+ description: Steps to reproduce the behavior
21
+ validations:
22
+ required: true
23
+ - type: textarea
24
+ id: expected
25
+ attributes:
26
+ label: Expected behavior
27
+ description: A clear and concise description of what you expected to happen
28
+ validations:
29
+ required: true
30
+ - type: textarea
31
+ id: environment
32
+ attributes:
33
+ label: Your Environment
34
+ description: |
35
+ - Fluentd or td-agent version: `fluentd --version` or `td-agent --version`
36
+ - Operating system: `cat /etc/os-release`
37
+ - Kernel version: `uname -r`
38
+
39
+ Tip: If you hit the problem with older fluentd version, try latest version first.
40
+ value: |
41
+ - Fluentd version:
42
+ - TD Agent/Fluent Package version:
43
+ - fluent-plugin-mongo version:
44
+ - mongo version:
45
+ - Operating system:
46
+ - Kernel version:
47
+ render: markdown
48
+ validations:
49
+ required: true
50
+ - type: textarea
51
+ id: configuration
52
+ attributes:
53
+ label: Your Configuration
54
+ description: |
55
+ Write your configuration here. Minimum reproducible fluentd.conf is recommended.
56
+ validations:
57
+ required: true
58
+ - type: textarea
59
+ id: logs
60
+ attributes:
61
+ label: Your Error Log
62
+ description: Write your ALL error log here
63
+ render: shell
64
+ validations:
65
+ required: true
66
+ - type: textarea
67
+ id: addtional-context
68
+ attributes:
69
+ label: Additional context
70
+ description: Add any other context about the problem here.
71
+ validations:
72
+ required: false
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Ask a Question
4
+ url: https://discuss.fluentd.org/
5
+ about: I have questions about fluent-plugin-mongo. Please ask and answer questions at https://discuss.fluentd.org/.
@@ -0,0 +1,38 @@
1
+ name: Feature request
2
+ description: Suggest an idea for this project
3
+ labels: "waiting-for-triage"
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ Please check the [README](https://github.com/fluent/fluent-plugin-mongo/blob/master/README.rdoc) first. To help us understand the request, please provide the following information.
9
+ - type: textarea
10
+ id: description
11
+ attributes:
12
+ label: Is your feature request related to a problem? Please describe.
13
+ description: |
14
+ A clear and concise description of what the problem is.
15
+ Ex. I'm always frustrated when [...]
16
+ validations:
17
+ required: true
18
+ - type: textarea
19
+ id: solution
20
+ attributes:
21
+ label: Describe the solution you'd like
22
+ description: A clear and concise description of what you want to happen.
23
+ validations:
24
+ required: true
25
+ - type: textarea
26
+ id: alternative
27
+ attributes:
28
+ label: Describe alternatives you've considered
29
+ description: A clear and concise description of any alternative solutions or features you've considered.
30
+ validations:
31
+ required: true
32
+ - type: textarea
33
+ id: addtional-context
34
+ attributes:
35
+ label: Additional context
36
+ description: Add any other context or screenshots about the feature request here.
37
+ validations:
38
+ required: false
@@ -3,4 +3,4 @@ updates:
3
3
  - package-ecosystem: 'github-actions'
4
4
  directory: '/'
5
5
  schedule:
6
- interval: 'weekly'
6
+ interval: 'monthly'
@@ -0,0 +1,24 @@
1
+ name: Add bugs to fluent project
2
+
3
+ on:
4
+ issues:
5
+ types:
6
+ - opened
7
+
8
+ jobs:
9
+ add-to-project:
10
+ name: Add issue to project
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Generate token
14
+ id: generate_token
15
+ uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
16
+ with:
17
+ app-id: ${{ secrets.PROJECT_APP_ID }}
18
+ private-key: ${{ secrets.PROJECT_APP_PRIVATE_KEY }}
19
+ owner: fluent
20
+ - uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e # v1.0.2
21
+ with:
22
+ project-url: https://github.com/orgs/fluent/projects/4
23
+ github-token: ${{ steps.generate_token.outputs.token }}
24
+ labeled: waiting-for-triage
@@ -4,40 +4,34 @@ on:
4
4
  branches: [master]
5
5
  pull_request:
6
6
  branches: [master]
7
+ schedule:
8
+ - cron: '0 0 1 * *'
7
9
  jobs:
10
+ ruby-versions:
11
+ uses: ruby/actions/.github/workflows/ruby_versions.yml@master
12
+ with:
13
+ engine: cruby
14
+ min_version: 2.7
8
15
  build:
16
+ needs: ruby-versions
9
17
  runs-on: ${{ matrix.os }}
10
- continue-on-error: ${{ matrix.experimental }}
18
+ continue-on-error: ${{ matrix.ruby == 'head' }}
11
19
  strategy:
12
20
  fail-fast: false
13
21
  matrix:
14
- ruby: [ '4.0', '3.4', '3.3', '3.2', '3.1', '3.0', '2.7' ]
15
- mongodb-version: ['5.0', '4.4', '4.2']
22
+ ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
23
+ mongodb-version: ['8.0', '7.0', '6.0', '5.0', '4.4', '4.2']
16
24
  os:
17
25
  - ubuntu-latest
18
- experimental: [false]
19
- include:
20
- - ruby: head
21
- os: ubuntu-latest
22
- experimental: true
23
- mongodb-version: '4.0'
24
- - ruby: head
25
- os: ubuntu-latest
26
- experimental: true
27
- mongodb-version: '4.2'
28
- - ruby: head
29
- os: ubuntu-latest
30
- experimental: true
31
- mongodb-version: '4.4'
32
26
 
33
27
  name: Ruby ${{ matrix.ruby }} and MongoDB ${{ matrix.mongodb-version }} on ${{ matrix.os }}
34
28
  steps:
35
- - uses: actions/checkout@v3
36
- - uses: ruby/setup-ruby@v1
29
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
30
+ - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
37
31
  with:
38
32
  ruby-version: ${{ matrix.ruby }}
39
33
  - name: Start MongoDB
40
- uses: supercharge/mongodb-github-action@1.8.0
34
+ uses: supercharge/mongodb-github-action@315db7fe45ac2880b7758f1933e6e5d59afd5e94 # v1.12.1
41
35
  with:
42
36
  mongodb-version: ${{ matrix.mongodb-version }}
43
37
  - name: unit testing
data/ChangeLog CHANGED
@@ -1,3 +1,9 @@
1
+ Release 1.6.2 - 2026/04/23
2
+
3
+ * out_mongo: prevent infinite retry on MaxBSONSize error (#206)
4
+ * out_mongo: fix NoMethodError during gracefulReload (#205)
5
+ * Add support for MongoDB 6.0, 7.0, 8.0 (#177)
6
+
1
7
  Release 1.6.1 - 2026/02/12
2
8
 
3
9
  * out_mongo: Fix RangeError by converting large integers to BSON::Decimal128
data/README.rdoc CHANGED
@@ -17,6 +17,17 @@ The gem is hosted at {Rubygems.org}[http://rubygems.org]. You can install the ge
17
17
 
18
18
  $ fluent-gem install fluent-plugin-mongo
19
19
 
20
+ === For Windows users
21
+
22
+ This plugin depends on the C extension library (such as `bson` gem) which requires a C compiler to install.
23
+
24
+ If you are using Windows, you must install the {MSYS2}[https://www.msys2.org/] development toolchain before installing this plugin:
25
+
26
+ 1. Run the following command in your command prompt:
27
+ $ ridk install
28
+ 2. Select option `3` (MSYS2 and MINGW development toolchain).
29
+ 3. Once the compiler installation is complete, run the <tt>ridk exec fluent-gem install fluent-plugin-mongo</tt> command.
30
+
20
31
  = Plugins
21
32
 
22
33
  == Output plugin
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.6.1
1
+ 1.6.2
@@ -186,7 +186,7 @@ module Fluent::Plugin
186
186
  end
187
187
 
188
188
  def shutdown
189
- @client.close
189
+ @client&.close
190
190
  super
191
191
  end
192
192
 
@@ -359,6 +359,9 @@ module Fluent::Plugin
359
359
  rescue Mongo::Error::BulkWriteError => e
360
360
  log.warn "#{records.size - e.result["n_inserted"]} documents are not inserted. Maybe these documents are invalid as a BSON."
361
361
  forget_collection(collection)
362
+ rescue Mongo::Error::MaxBSONSize => e
363
+ log.warn e
364
+ raise Fluent::UnrecoverableError, e
362
365
  rescue ArgumentError => e
363
366
  log.warn e
364
367
  end
@@ -229,8 +229,6 @@ class MongoOutputTest < ::Test::Unit::TestCase
229
229
  @type mongo
230
230
  connection_string mongodb://localhost:#{port}/#{database_name}
231
231
  collection #{collection_name}
232
- capped
233
- capped_size 100
234
232
  expire_after 120
235
233
  ])
236
234
  assert_equal("mongodb://localhost:#{port}/#{database_name}", d.instance.connection_string)
@@ -622,4 +620,25 @@ class MongoOutputTest < ::Test::Unit::TestCase
622
620
  assert_nil actual_documents.first['my_id']['id']
623
621
  end
624
622
  end
623
+
624
+ def test_unrecoverable_error_on_huge_document
625
+ d = create_driver(%[
626
+ @type mongo
627
+ database test
628
+ collection test_unrecoverable
629
+ <buffer>
630
+ chunk_limit_size 30m
631
+ </buffer>
632
+ ])
633
+
634
+ d.run(default_tag: 'test') do
635
+ time = event_time("2011-01-02 13:14:15 UTC")
636
+ # The document size exceeds the 16MB limit of BSON, so it should raise an UnrecoverableError.
637
+ d.feed(time, {'msg' => 'x' * (20 * 1024 * 1024)})
638
+ end
639
+
640
+ logs = d.logs.join("\n")
641
+ assert_match(/got unrecoverable error.*Fluent::UnrecoverableError/, logs)
642
+ assert_match(/MaxBSONSize/, logs)
643
+ end
625
644
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-mongo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masahiro Nakagawa
@@ -154,7 +154,11 @@ executables:
154
154
  extensions: []
155
155
  extra_rdoc_files: []
156
156
  files:
157
+ - ".github/ISSUE_TEMPLATE/bug_report.yaml"
158
+ - ".github/ISSUE_TEMPLATE/config.yml"
159
+ - ".github/ISSUE_TEMPLATE/feature_request.yaml"
157
160
  - ".github/dependabot.yml"
161
+ - ".github/workflows/add-to-project.yml"
158
162
  - ".github/workflows/linux.yml"
159
163
  - ".gitignore"
160
164
  - AUTHORS
@@ -192,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
196
  - !ruby/object:Gem::Version
193
197
  version: '0'
194
198
  requirements: []
195
- rubygems_version: 4.0.3
199
+ rubygems_version: 4.0.6
196
200
  specification_version: 4
197
201
  summary: MongoDB plugin for Fluentd
198
202
  test_files: