fluentd 1.12.0.rc1 → 1.12.0.rc2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of fluentd might be problematic. Click here for more details.

@@ -111,6 +111,32 @@ class SupervisorTest < ::Test::Unit::TestCase
111
111
  $log.out.reset if $log && $log.out && $log.out.respond_to?(:reset)
112
112
  end
113
113
 
114
+ def test_main_process_command_handlers
115
+ omit "Only for Windows, alternative to UNIX signals" unless Fluent.windows?
116
+
117
+ create_info_dummy_logger
118
+
119
+ opts = Fluent::Supervisor.default_options
120
+ sv = Fluent::Supervisor.new(opts)
121
+ r, w = IO.pipe
122
+ $stdin = r
123
+ sv.send(:install_main_process_signal_handlers)
124
+
125
+ begin
126
+ w.write("GRACEFUL_RESTART\n")
127
+ w.flush
128
+ ensure
129
+ $stdin = STDIN
130
+ end
131
+
132
+ sleep 1
133
+
134
+ info_msg = '[info]: force flushing buffered events' + "\n"
135
+ assert{ $log.out.logs.first.end_with?(info_msg) }
136
+ ensure
137
+ $log.out.reset if $log && $log.out && $log.out.respond_to?(:reset)
138
+ end
139
+
114
140
  def test_supervisor_signal_handler
115
141
  omit "Windows cannot handle signals" if Fluent.windows?
116
142
 
@@ -137,21 +163,53 @@ class SupervisorTest < ::Test::Unit::TestCase
137
163
 
138
164
  server = DummyServer.new
139
165
  def server.config
140
- {:signame => "TestFluentdEvent", :worker_pid => {0 => 1234}}
166
+ {:signame => "TestFluentdEvent"}
141
167
  end
142
168
 
143
169
  mock(server).stop(true)
144
170
  stub(Process).kill.times(0)
145
171
 
146
- server.before_run
147
172
  server.install_windows_event_handler
148
- sleep 0.1 # Wait for starting windows event thread
149
- event = Win32::Event.open("TestFluentdEvent")
150
- event.set
151
- event.close
152
- # Wait for stopping windows event thread. Should larger than 1 sec
153
- # because the thread is awaked every 1 sec.
154
- sleep 1.1
173
+ begin
174
+ sleep 0.1 # Wait for starting windows event thread
175
+ event = Win32::Event.open("TestFluentdEvent")
176
+ event.set
177
+ event.close
178
+ ensure
179
+ server.stop_windows_event_thread
180
+ end
181
+
182
+ debug_msg = '[debug]: Got Win32 event "TestFluentdEvent"'
183
+ logs = $log.out.logs
184
+ assert{ logs.any?{|log| log.include?(debug_msg) } }
185
+ ensure
186
+ $log.out.reset if $log && $log.out && $log.out.respond_to?(:reset)
187
+ end
188
+
189
+ def test_supervisor_event_handler
190
+ omit "Only for Windows, alternative to UNIX signals" unless Fluent.windows?
191
+
192
+ create_debug_dummy_logger
193
+
194
+ server = DummyServer.new
195
+ def server.config
196
+ {:signame => "TestFluentdEvent"}
197
+ end
198
+ server.install_windows_event_handler
199
+ begin
200
+ sleep 0.1 # Wait for starting windows event thread
201
+ event = Win32::Event.open("TestFluentdEvent_USR1")
202
+ event.set
203
+ event.close
204
+ ensure
205
+ server.stop_windows_event_thread
206
+ end
207
+
208
+ debug_msg = '[debug]: Got Win32 event "TestFluentdEvent_USR1"'
209
+ logs = $log.out.logs
210
+ assert{ logs.any?{|log| log.include?(debug_msg) } }
211
+ ensure
212
+ $log.out.reset if $log && $log.out && $log.out.respond_to?(:reset)
155
213
  end
156
214
 
157
215
  def test_rpc_server
@@ -176,7 +234,7 @@ class SupervisorTest < ::Test::Unit::TestCase
176
234
  server.run_rpc_server
177
235
 
178
236
  sv.send(:install_main_process_signal_handlers)
179
- Net::HTTP.get URI.parse('http://0.0.0.0:24447/api/plugins.flushBuffers')
237
+ response = Net::HTTP.get(URI.parse('http://127.0.0.1:24447/api/plugins.flushBuffers'))
180
238
  info_msg = '[info]: force flushing buffered events' + "\n"
181
239
 
182
240
  server.stop_rpc_server
@@ -185,11 +243,45 @@ class SupervisorTest < ::Test::Unit::TestCase
185
243
  # This test will be passed in such environment.
186
244
  pend unless $log.out.logs.first
187
245
 
246
+ assert_equal('{"ok":true}', response)
188
247
  assert{ $log.out.logs.first.end_with?(info_msg) }
189
248
  ensure
190
249
  $log.out.reset if $log.out.is_a?(Fluent::Test::DummyLogDevice)
191
250
  end
192
251
 
252
+ def test_rpc_server_windows
253
+ omit "Only for windows platform" unless Fluent.windows?
254
+
255
+ create_info_dummy_logger
256
+
257
+ opts = Fluent::Supervisor.default_options
258
+ sv = Fluent::Supervisor.new(opts)
259
+ conf_data = <<-EOC
260
+ <system>
261
+ rpc_endpoint 0.0.0.0:24447
262
+ </system>
263
+ EOC
264
+ conf = Fluent::Config.parse(conf_data, "(test)", "(test_dir)", true)
265
+ sys_conf = sv.__send__(:build_system_config, conf)
266
+
267
+ server = DummyServer.new
268
+ def server.config
269
+ {
270
+ :signame => "TestFluentdEvent",
271
+ :worker_pid => 5963,
272
+ }
273
+ end
274
+ server.rpc_endpoint = sys_conf.rpc_endpoint
275
+
276
+ server.run_rpc_server
277
+
278
+ mock(server).restart(true) { nil }
279
+ response = Net::HTTP.get(URI.parse('http://127.0.0.1:24447/api/plugins.flushBuffers'))
280
+
281
+ server.stop_rpc_server
282
+ assert_equal('{"ok":true}', response)
283
+ end
284
+
193
285
  def test_load_config
194
286
  tmp_dir = "#{TMP_DIR}/dir/test_load_config.conf"
195
287
  conf_info_str = %[
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluentd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0.rc1
4
+ version: 1.12.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-19 00:00:00.000000000 Z
11
+ date: 2020-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -361,6 +361,7 @@ executables:
361
361
  - fluent-ca-generate
362
362
  - fluent-cap-ctl
363
363
  - fluent-cat
364
+ - fluent-ctl
364
365
  - fluent-debug
365
366
  - fluent-gem
366
367
  - fluent-plugin-config-format
@@ -372,10 +373,11 @@ files:
372
373
  - ".drone.yml"
373
374
  - ".github/ISSUE_TEMPLATE.md"
374
375
  - ".github/ISSUE_TEMPLATE/bug_report.md"
376
+ - ".github/ISSUE_TEMPLATE/config.yml"
375
377
  - ".github/ISSUE_TEMPLATE/feature_request.md"
376
378
  - ".github/PULL_REQUEST_TEMPLATE.md"
377
- - ".github/stale.yml"
378
379
  - ".github/workflows/issue-auto-closer.yml"
380
+ - ".github/workflows/stale-actions.yml"
379
381
  - ".gitignore"
380
382
  - ".gitlab-ci.yml"
381
383
  - ".travis.yml"
@@ -395,6 +397,7 @@ files:
395
397
  - bin/fluent-ca-generate
396
398
  - bin/fluent-cap-ctl
397
399
  - bin/fluent-cat
400
+ - bin/fluent-ctl
398
401
  - bin/fluent-debug
399
402
  - bin/fluent-gem
400
403
  - bin/fluent-plugin-config-format
@@ -449,6 +452,7 @@ files:
449
452
  - lib/fluent/command/ca_generate.rb
450
453
  - lib/fluent/command/cap_ctl.rb
451
454
  - lib/fluent/command/cat.rb
455
+ - lib/fluent/command/ctl.rb
452
456
  - lib/fluent/command/debug.rb
453
457
  - lib/fluent/command/fluentd.rb
454
458
  - lib/fluent/command/plugin_config_formatter.rb
@@ -695,6 +699,7 @@ files:
695
699
  - test/command/test_binlog_reader.rb
696
700
  - test/command/test_ca_generate.rb
697
701
  - test/command/test_cap_ctl.rb
702
+ - test/command/test_ctl.rb
698
703
  - test/command/test_fluentd.rb
699
704
  - test/command/test_plugin_config_formatter.rb
700
705
  - test/command/test_plugin_generator.rb
@@ -931,6 +936,7 @@ test_files:
931
936
  - test/command/test_binlog_reader.rb
932
937
  - test/command/test_ca_generate.rb
933
938
  - test/command/test_cap_ctl.rb
939
+ - test/command/test_ctl.rb
934
940
  - test/command/test_fluentd.rb
935
941
  - test/command/test_plugin_config_formatter.rb
936
942
  - test/command/test_plugin_generator.rb
@@ -1,22 +0,0 @@
1
- # Number of days of inactivity before an issue becomes stale
2
- daysUntilStale: 90
3
- # Number of days of inactivity before a stale issue is closed
4
- daysUntilClose: 30
5
- # Issues with these labels will never be considered stale
6
- exemptLabels:
7
- - bug
8
- - enhancement
9
- - feature request
10
- - pending
11
- - work_in_progress
12
- - v1
13
- - v2
14
- # Label to use when marking an issue as stale
15
- staleLabel: stale
16
- # Comment to post when marking an issue as stale. Set to `false` to disable
17
- markComment: >
18
- This issue has been automatically marked as stale because it has not had
19
- recent activity. It will be closed if no further activity occurs. Thank you
20
- for your contributions.
21
- # Comment to post when closing a stale issue. Set to `false` to disable
22
- closeComment: true