# Locked Threads on Logstash 2.4

**URL:** <https://discuss.elastic.co/t/locked-threads-on-logstash-2-4/83094>\
**Category:** Logstash\
**Created:** [April 20, 2017, 4:57pm UTC](https://discuss.elastic.co/t/locked-threads-on-logstash-2-4/83094 "2017-04-20T16:57:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lonangel](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@lonangel](https://discuss.elastic.co/u/lonangel)\
**Post date:** [April 20, 2017, 4:57pm UTC](https://discuss.elastic.co/t/locked-threads-on-logstash-2-4/83094/1 "2017-04-20T16:57:22Z")

</div>

Hi there,

I have a workflow with two Logstash's and a rabbitmq in the middle to store messages temporarily.

On the second logstash, the one behind the rabbitmq, I'm using the following code to set a field with the time the message reached the logstash:

> filter {  
> ruby {  
> code =\> "event.set('process\_time',Time.now.utc.strftime('%FT%T.%LZ'))"  
> }  
> }

After some time It stops getting messages from the rabbitmq queue and when i try to restart the service I get the following error:

> {"inflight\_count"=\>45111, "stalling\_thread\_info"=\>{["LogStash::Filters::Ruby", {"code"=\>"event.set('process\_time',Time.now.utc.strftime('%FT%T.%LZ'))"}]=\>[{"thread\_id"=\>58, "name"=\>"[main]\>worker0", "current\_call"=\>"[...]/vendor/bundle/jruby/1.9/gems/manticore-0.6.1-java/lib/manticore/response.rb:50:in `call'"}, {"thread_id"=>59, "name"=>"[main]>worker1", "current_call"=>"[...]/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.1-java/lib/logstash/output_delegator.rb:128:in `pop'"}, {"thread\_id"=\>60, "name"=\>"[main]\>worker2", "current\_call"=\>"[...]/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.1-java/lib/logstash/output\_delegator.rb:128:in `pop'"}, {"thread_id"=>61, "name"=>"[main]>worker3", "current_call"=>"[...]/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.1-java/lib/logstash/output_delegator.rb:128:in `pop'"}, {"thread\_id"=\>63, "name"=\>"[main]\>worker5", "current\_call"=\>"[...]/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.1-java/lib/logstash/output\_delegator.rb:128:in `pop'"}, {"thread_id"=>64, "name"=>"[main]>worker6", "current_call"=>"[...]/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.1-java/lib/logstash/output_delegator.rb:128:in `pop'"}, {"thread\_id"=\>65, "name"=\>"[main]\>worker7", "current\_call"=\>"[...]/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.1-java/lib/logstash/output\_delegator.rb:128:in `pop'"}, {"thread_id"=>66, "name"=>"[main]>worker8", "current_call"=>"[...]/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.1-java/lib/logstash/output_delegator.rb:128:in `pop'"}, {"thread\_id"=\>68, "name"=\>"[main]\>worker10", "current\_call"=\>"[...]/vendor/bundle/jruby/1.9/gems/manticore-0.6.1-java/lib/manticore/response.rb:50:in `call'"}, {"thread_id"=>69, "name"=>"[main]>worker11", "current_call"=>"[...]/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.1-java/lib/logstash/output_delegator.rb:128:in `pop'"}, {"thread\_id"=\>70, "name"=\>"[main]\>worker12", "current\_call"=\>"[...]/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.1-java/lib/logstash/output\_delegator.rb:128:in `pop'"}, {"thread_id"=>71, "name"=>"[main]>worker13", "current_call"=>"[...]/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.1-java/lib/logstash/output_delegator.rb:128:in `pop'"}, {"thread\_id"=\>72, "name"=\>"[main]\>worker14", "current\_call"=\>"[...]/vendor/bundle/jruby/1.9/gems/manticore-0.6.1-java/lib/manticore/response.rb:50:in `call'"}, {"thread_id"=>73, "name"=>"[main]>worker15", "current_call"=>"[...]/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.1-java/lib/logstash/output_delegator.rb:128:in `pop'"}]}} {:level=\>:warn}

I can't find information about ruby filter and if it's thread-safe.

Also is there any other way to timestamp the message when it reaches certain point on the pipeline?

---

<div class="post-metadata">

**Author:** ![jsvd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsvd/32/6203_2.png) [@jsvd](https://discuss.elastic.co/u/jsvd)\
**Post date:** [April 28, 2017, 3:29pm UTC](https://discuss.elastic.co/t/locked-threads-on-logstash-2-4/83094/2 "2017-04-28T15:29:55Z")

</div>

all those stacks calls in `response.rb:50:in call` are sending data to elasticsearch, while the others at `output_delegator.rb:128:in pop` are outputs waiting to received data so they can push it out.

It seems logstash isn't able to send all data out to elasticsearch, so it is stalled, are there any other log error messages either in logstash or elasticsearch?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 26, 2017, 3:43pm UTC](https://discuss.elastic.co/t/locked-threads-on-logstash-2-4/83094/3 "2017-05-26T15:43:28Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
