Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jdbc input errors at start-up prevent pipeline termination/reloading #80

Closed
jsvd opened this issue Jul 9, 2021 · 1 comment · Fixed by #85
Closed

jdbc input errors at start-up prevent pipeline termination/reloading #80

jsvd opened this issue Jul 9, 2021 · 1 comment · Fixed by #85
Labels
bug Something isn't working int-shortlist

Comments

@jsvd
Copy link
Member

jsvd commented Jul 9, 2021

Connectivity issues in during startup of jdbc input such as an invalid password are retried forever.
During these retries the status of stop? is never checked so the pipeline blocks reloadings.

The issue comes from the rufus scheduler by default catching exceptions in the jobs it executes. It's necessary to catch these exceptions and terminate the scheduler if the pipeline is terminating.

@jsvd jsvd added bug Something isn't working status:needs-triage labels Jul 9, 2021
@kaisecheng
Copy link
Contributor

kaisecheng commented Oct 25, 2021

A deadlock related to ReentrantLock is involved in the issue with invalid password setting.

Input plugin start scheduler to connect database with lock, however, open_jdbc_connection() fail and it is not in begin ensure. The plugin retried forever.
User updates central pipeline management with the correct password, the reload path in other thread require the same lock. This is also the case in shutdown path.

thread run
execute_statement [jdbc.rb:211] (LogStash::PluginMixins::Jdbc::Jdbc)
execute_query [jdbc.rb:335] (LogStash::Inputs::Jdbc)
run [jdbc.rb:298] (LogStash::Inputs::Jdbc)
do_call [jobs.rb:234] (Rufus::Scheduler::Job)
do_trigger [jobs.rb:258] (Rufus::Scheduler::Job)
start_work_thread [jobs.rb:300] (Rufus::Scheduler::Job)
start_work_thread [jobs.rb:299] (Rufus::Scheduler::Job)
start_work_thread [jobs.rb:289] (Rufus::Scheduler::Job)

thread reload (update Central pipeline managment)
close_jdbc_connection [jdbc.rb:196] (LogStash::PluginMixins::Jdbc::Jdbc)
stop [jdbc.rb:312] (LogStash::Inputs::Jdbc)
do_stop [base.rb:103] (LogStash::Inputs::Base)
stop_inputs [java_pipeline.rb:458] (LogStash::JavaPipeline)
shutdown [java_pipeline.rb:447] (LogStash::JavaPipeline)
execute [reload.rb:67] (LogStash::PipelineAction::Reload)
reload_pipeline [pipelines_registry.rb:213] (LogStash::PipelinesRegistry)
execute [reload.rb:62] (LogStash::PipelineAction::Reload)
converge_state [agent.rb:384] (LogStash::Agent)

thread stop (^C)
close_jdbc_connection [jdbc.rb:199] (LogStash::PluginMixins::Jdbc::Jdbc)
stop [jdbc.rb:312] (LogStash::Inputs::Jdbc)
do_stop [base.rb:103] (LogStash::Inputs::Base)
stop_inputs [java_pipeline.rb:458] (LogStash::JavaPipeline)
shutdown [java_pipeline.rb:447] (LogStash::JavaPipeline)
execute [stop.rb:30] (LogStash::PipelineAction::Stop)
terminate_pipeline [pipelines_registry.rb:186] (LogStash::PipelinesRegistry)
execute [stop.rb:29] (LogStash::PipelineAction::Stop)
converge_state [agent.rb:384] (LogStash::Agent)

kaisecheng added a commit to kaisecheng/logstash-integration-jdbc that referenced this issue Oct 26, 2021
kaisecheng added a commit that referenced this issue Nov 2, 2021
* Fix connection lock to unblock pipeline reload
* update to logstash-devutils 2.3.0
Fixed: #80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working int-shortlist
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants