Skip to content

Commit

Permalink
Fix thread and memory leak on pipeline reload.
Browse files Browse the repository at this point in the history
When a pipeline is reloaded, the rufus stop/shutdown method is called without any arguments. This instructs rufus to leave it's worker threads running. To fully shutdown the rufus worker threads, a :wait or :kill is needed. This change sends the :wait parameter to the shutdown method to ensure that the work thread is stopped. Prior to this change, the thread and all associated memory would stay in the JVM indefinitely.

Fixes #255

Fixes #256
  • Loading branch information
jakelandis committed Dec 14, 2017
1 parent b64e0ec commit 4230f04
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,6 @@
## 4.3.3
- [#255](https://github.com/logstash-plugins/logstash-input-jdbc/issues/255) Fix thread and memory leak.

## 4.3.2
- [#251](https://github.com/logstash-plugins/logstash-input-jdbc/issues/251) Fix connection and memory leak.

Expand Down
2 changes: 1 addition & 1 deletion lib/logstash/inputs/jdbc.rb
Expand Up @@ -260,7 +260,7 @@ def run(queue)

def stop
close_jdbc_connection
@scheduler.stop if @scheduler
@scheduler.shutdown(:wait) if @scheduler
end

private
Expand Down
2 changes: 1 addition & 1 deletion logstash-input-jdbc.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'logstash-input-jdbc'
s.version = '4.3.2'
s.version = '4.3.3'
s.licenses = ['Apache License (2.0)']
s.summary = "Creates events from JDBC data"
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"
Expand Down

0 comments on commit 4230f04

Please sign in to comment.