logstash-input-jdbc 4.3.3 → 4.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e6e0b7edc864e0dbf118ae0914cf9e90a206adbc5355553f939f25a743249a4
4
- data.tar.gz: e0591ca8fd7abbe2fe50d8612f16d2c752c8b57dbf578ca042d029b4b06bad73
3
+ metadata.gz: 4182f11b49a8109b280f7c078b547a71b3c7134dc54834b06705f94ba064d216
4
+ data.tar.gz: 6decb981a1ce99e9aac59da1b0259968db299e348d16c76a83cac07e87a58fa8
5
5
  SHA512:
6
- metadata.gz: 2fe8cb1056311e63dd228ea4b2939d4395ee8abe8a23b938d56ebc31bf71cea958482fa6abc159ac64282e604eb33ef28f31bf75918552f1c4cc226de7e8b85f
7
- data.tar.gz: cbf609402167ea1bd6e4d5ec3ec9a1cfd6eb0135989046395645bc3eb99347832931a9f432c7f6c7e3d03639e69565a4cc143086e6c635162957972cb442dcbd
6
+ metadata.gz: 8d9cb81fe24f6f301166f2f8baeaa90f18e43f4d3d7ef0ff9c09516d9edd57a5bf6e4eaa9d3a112af7616b062b39f781384dbc25ee3ef9a20fbc1594e36612ca
7
+ data.tar.gz: e2b979fdfc781cda71aaa0aa1232f9c25b21e120f89ec07729e3bb41e68a57cd7d6d8c467a6db79bf66a83d2f9f29209d2ed76877fe1595af0ee6e2190649152
@@ -1,3 +1,6 @@
1
+ ## 4.3.4
2
+ - [#261](https://github.com/logstash-plugins/logstash-input-jdbc/issues/261) Fix memory leak.
3
+
1
4
  ## 4.3.3
2
5
  - [#255](https://github.com/logstash-plugins/logstash-input-jdbc/issues/255) Fix thread and memory leak.
3
6
 
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012–2016 Elasticsearch <http://www.elastic.co>
1
+ Copyright (c) 2012-2018 Elasticsearch <http://www.elastic.co>
2
2
 
3
3
  Licensed under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License.
@@ -103,7 +103,8 @@ module LogStash::PluginMixins::Jdbc
103
103
  opts = {
104
104
  :user => @jdbc_user,
105
105
  :password => @jdbc_password.nil? ? nil : @jdbc_password.value,
106
- :pool_timeout => @jdbc_pool_timeout
106
+ :pool_timeout => @jdbc_pool_timeout,
107
+ :keep_reference => false
107
108
  }.merge(@sequel_opts)
108
109
  retry_attempts = @connection_retry_attempts
109
110
  loop do
@@ -232,24 +233,12 @@ module LogStash::PluginMixins::Jdbc
232
233
  @tracking_column_warning_sent = false
233
234
  @logger.debug? and @logger.debug("Executing JDBC query", :statement => statement, :parameters => parameters, :count => query.count)
234
235
 
235
- if @jdbc_paging_enabled
236
- query.each_page(@jdbc_page_size) do |paged_dataset|
237
- paged_dataset.each do |row|
238
- sql_last_value = get_column_value(row) if @use_column_value
239
- if @tracking_column_type=="timestamp" and @use_column_value and sql_last_value.is_a?(DateTime)
240
- sql_last_value=Time.parse(sql_last_value.to_s) # Coerce the timestamp to a `Time`
241
- end
242
- yield extract_values_from(row)
243
- end
244
- end
245
- else
246
- query.each do |row|
247
- sql_last_value = get_column_value(row) if @use_column_value
248
- if @tracking_column_type=="timestamp" and @use_column_value and sql_last_value.is_a?(DateTime)
249
- sql_last_value=Time.parse(sql_last_value.to_s) # Coerce the timestamp to a `Time`
250
- end
251
- yield extract_values_from(row)
236
+ perform_query(query) do |row|
237
+ sql_last_value = get_column_value(row) if @use_column_value
238
+ if @tracking_column_type=="timestamp" and @use_column_value and sql_last_value.is_a?(DateTime)
239
+ sql_last_value = sql_last_value.to_time # Coerce the timestamp to a `Time`
252
240
  end
241
+ yield extract_values_from(row)
253
242
  end
254
243
  success = true
255
244
  rescue Sequel::DatabaseConnectionError, Sequel::DatabaseError => e
@@ -263,6 +252,24 @@ module LogStash::PluginMixins::Jdbc
263
252
  return success
264
253
  end
265
254
 
255
+ # Performs the query, respecting our pagination settings, yielding once per row of data
256
+ # @param query [Sequel::Dataset]
257
+ # @yieldparam row [Hash{Symbol=>Object}]
258
+ private
259
+ def perform_query(query)
260
+ if @jdbc_paging_enabled
261
+ query.each_page(@jdbc_page_size) do |paged_dataset|
262
+ paged_dataset.each do |row|
263
+ yield row
264
+ end
265
+ end
266
+ else
267
+ query.each do |row|
268
+ yield row
269
+ end
270
+ end
271
+ end
272
+
266
273
  public
267
274
  def get_column_value(row)
268
275
  if !row.has_key?(@tracking_column.to_sym)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-jdbc'
3
- s.version = '4.3.3'
3
+ s.version = '4.3.4'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = "Creates events from JDBC data"
6
6
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-jdbc
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.3
4
+ version: 4.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-14 00:00:00.000000000 Z
11
+ date: 2018-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement