fluentd 1.6.1 → 1.6.2

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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1fef23fb6e94b2100154a4ef1618ad628435118b13fc9c1f6884e69ecc221368
4
- data.tar.gz: 6d1eb5b941ce9df4987fcf19f0345d46965534d858205ed07c71c67e7b8c2966
3
+ metadata.gz: faae0c0f8e371e91fb6cf69bbe368546910282f29d2a447d6aa79eb9ed006913
4
+ data.tar.gz: 0a28223bc8471c15756a49ad89aac13456dc8ae9b7f31364043db86f95d76213
5
5
  SHA512:
6
- metadata.gz: b426456c884540d5bd9aafbd0c7e3f5dec5a64db50ce631a09a93d2dfee1adeff8f96f051ffc4702ac464ea91d05a485866838f0ea383380d397a3073363da67
7
- data.tar.gz: 34791ef0f1498fc68e27935ed3d9f1393d1aaa28f39ee1718f679f5aef2c8c0094301d49edbde5b793651a8226efe7f070ab4f422dffe7da2a6bc833f297cf6a
6
+ metadata.gz: d21f537df92d813568d963c8f49775f187013a804a8be59e39e8f2e6cf970de28236bb133d3f2071dba73d73e56f172d233a263b756615f1543d4c1994a2e6f8
7
+ data.tar.gz: 042fa8d384f3698ae556f66eefce7f718c132ad63edd16ecab0a9bbc989d3a0497dfd4b9fe7ad5246519cec78a8f9ed51e05967ac8db01b08f7e541eb7d2b2e7
@@ -1,5 +1,12 @@
1
1
  # v1.6
2
2
 
3
+ ## Release v1.6.2 - 2019/07/11
4
+
5
+ ### Bug fixes
6
+
7
+ * http_server helper: Add title argument to support multiple servers
8
+ https://github.com/fluent/fluentd/pull/2493
9
+
3
10
  ## Release v1.6.1 - 2019/07/10
4
11
 
5
12
  ### Enhancement
@@ -208,7 +208,7 @@ module Fluent::Plugin
208
208
 
209
209
  log.debug "listening monitoring http server on http://#{@bind}:#{@port}/api/plugins for worker#{fluentd_worker_id}"
210
210
  api_handler = APIHandler.new(self)
211
- create_http_server(addr: @bind, port: @port, logger: log, default_app: NotFoundJson) do |serv|
211
+ create_http_server(:in_monitor_http_server_helper, addr: @bind, port: @port, logger: log, default_app: NotFoundJson) do |serv|
212
212
  serv.get('/api/plugins') { |req| api_handler.plugins_ltsv(req) }
213
213
  serv.get('/api/plugins.json') { |req| api_handler.plugins_json(req) }
214
214
  serv.get('/api/config') { |req| api_handler.config_ltsv(req) }
@@ -34,11 +34,12 @@ module Fluent
34
34
  # close : correct stopped threads
35
35
  # terminate: kill thread
36
36
 
37
+ # @param title [Symbol] the thread name. this value should be unique.
37
38
  # @param addr [String] Listen address
38
39
  # @param port [String] Listen port
39
40
  # @param logger [Logger] logger used in this server
40
41
  # @param default_app [Object] This method must have #call.
41
- def create_http_server(addr:, port:, logger:, default_app: nil)
42
+ def create_http_server(title, addr:, port:, logger:, default_app: nil)
42
43
  unless block_given?
43
44
  raise ArgumentError, 'BUG: callback not specified'
44
45
  end
@@ -48,7 +49,7 @@ module Fluent
48
49
  end
49
50
 
50
51
  _block_until_http_server_start do |notify|
51
- thread_create(:plugin_helper_http_server) do
52
+ thread_create(title) do
52
53
  @_http_server.start(notify)
53
54
  end
54
55
  end
@@ -16,6 +16,6 @@
16
16
 
17
17
  module Fluent
18
18
 
19
- VERSION = '1.6.1'
19
+ VERSION = '1.6.2'
20
20
 
21
21
  end
@@ -50,7 +50,8 @@ class HtttpHelperTest < Test::Unit::TestCase
50
50
  %w[get head].each do |n|
51
51
  define_method(n) do |uri, header = {}|
52
52
  url = URI.parse(uri)
53
- req = Net::HTTP.const_get(n.capitalize).new(url, header)
53
+ headers = { 'Content-Type' => 'application/x-www-form-urlencoded/' }.merge(header)
54
+ req = Net::HTTP.const_get(n.capitalize).new(url, headers)
54
55
  Net::HTTP.start(url.host, url.port) do |http|
55
56
  http.request(req)
56
57
  end
@@ -60,7 +61,8 @@ class HtttpHelperTest < Test::Unit::TestCase
60
61
  %w[post put patch delete options trace].each do |n|
61
62
  define_method(n) do |uri, body = '', header = {}|
62
63
  url = URI.parse(uri)
63
- req = Net::HTTP.const_get(n.capitalize).new(url, header)
64
+ headers = { 'Content-Type' => 'application/x-www-form-urlencoded/' }.merge(header)
65
+ req = Net::HTTP.const_get(n.capitalize).new(url, headers)
64
66
  req.body = body
65
67
  Net::HTTP.start(url.host, url.port) do |http|
66
68
  http.request(req)
@@ -71,7 +73,7 @@ class HtttpHelperTest < Test::Unit::TestCase
71
73
  sub_test_case 'Create a HTTP server' do
72
74
  test 'monunt given path' do
73
75
  on_driver do |driver|
74
- driver.create_http_server(addr: '127.0.0.1', port: PORT, logger: NULL_LOGGER) do |s|
76
+ driver.create_http_server(:http_server_helper_test, addr: '127.0.0.1', port: PORT, logger: NULL_LOGGER) do |s|
75
77
  s.get('/example/hello') { [200, { 'Content-Type' => 'text/plain' }, 'hello get'] }
76
78
  s.post('/example/hello') { [200, { 'Content-Type' => 'text/plain' }, 'hello post'] }
77
79
  s.head('/example/hello') { [200, { 'Content-Type' => 'text/plain' }, 'hello head'] }
@@ -106,7 +108,7 @@ class HtttpHelperTest < Test::Unit::TestCase
106
108
 
107
109
  test 'when path does not start with `/` or ends with `/`' do
108
110
  on_driver do |driver|
109
- driver.create_http_server(addr: '127.0.0.1', port: PORT, logger: NULL_LOGGER) do |s|
111
+ driver.create_http_server(:http_server_helper_test, addr: '127.0.0.1', port: PORT, logger: NULL_LOGGER) do |s|
110
112
  s.get('example/hello') { [200, { 'Content-Type' => 'text/plain' }, 'hello get'] }
111
113
  s.get('/example/hello2/') { [200, { 'Content-Type' => 'text/plain' }, 'hello get'] }
112
114
  end
@@ -121,7 +123,7 @@ class HtttpHelperTest < Test::Unit::TestCase
121
123
 
122
124
  test 'when error raised' do
123
125
  on_driver do |driver|
124
- driver.create_http_server(addr: '127.0.0.1', port: PORT, logger: NULL_LOGGER) do |s|
126
+ driver.create_http_server(:http_server_helper_test, addr: '127.0.0.1', port: PORT, logger: NULL_LOGGER) do |s|
125
127
  s.get('/example/hello') { raise 'error!' }
126
128
  end
127
129
 
@@ -132,7 +134,7 @@ class HtttpHelperTest < Test::Unit::TestCase
132
134
 
133
135
  test 'when path is not found' do
134
136
  on_driver do |driver|
135
- driver.create_http_server(addr: '127.0.0.1', port: PORT, logger: NULL_LOGGER) do |s|
137
+ driver.create_http_server(:http_server_helper_test, addr: '127.0.0.1', port: PORT, logger: NULL_LOGGER) do |s|
136
138
  s.get('/example/hello') { [200, { 'Content-Type' => 'text/plain' }, 'hello get'] }
137
139
  end
138
140
 
@@ -143,7 +145,7 @@ class HtttpHelperTest < Test::Unit::TestCase
143
145
 
144
146
  test 'params and body' do
145
147
  on_driver do |driver|
146
- driver.create_http_server(addr: '127.0.0.1', port: PORT, logger: NULL_LOGGER) do |s|
148
+ driver.create_http_server(:http_server_helper_test, addr: '127.0.0.1', port: PORT, logger: NULL_LOGGER) do |s|
147
149
  s.get('/example/hello') do |req|
148
150
  assert_equal(req.query_string, nil)
149
151
  assert_equal(req.body, nil)
@@ -193,7 +195,7 @@ class HtttpHelperTest < Test::Unit::TestCase
193
195
  end
194
196
 
195
197
  stub(Fluent::PluginHelper::HttpServer::Server).new(anything) { server }
196
- driver.create_http_server(addr: '127.0.0.1', port: PORT, logger: NULL_LOGGER) do
198
+ driver.create_http_server(:http_server_helper_test, addr: '127.0.0.1', port: PORT, logger: NULL_LOGGER) do
197
199
  # nothing
198
200
  end
199
201
  driver.stop
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.6.1
4
+ version: 1.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-11 00:00:00.000000000 Z
11
+ date: 2019-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack