# Pipeline disabling

**URL:** <https://discuss.elastic.co/t/pipeline-disabling/213604>\
**Category:** Logstash\
**Created:** [January 2, 2020, 5:39pm UTC](https://discuss.elastic.co/t/pipeline-disabling/213604 "2020-01-02T17:39:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pchakour](https://avatars.discourse-cdn.com/v4/letter/p/e36b37/32.png) [@pchakour](https://discuss.elastic.co/u/pchakour)\
**Post date:** [January 2, 2020, 5:39pm UTC](https://discuss.elastic.co/t/pipeline-disabling/213604/1 "2020-01-02T17:39:20Z")

</div>

Hello !

I'm currently working on the logstash 7.5.1.  
I'm using the multiple pipelines file with the auto reload mode to create and delete pipelines when logstash is running.

I noticed that Logstash doesn't create a pipeline if I do the following steps :

1. I add a pipeline with a specific ID
2. I remove this pipeline
3. I add a new pipeline with the same ID

So, I want to know if this behavior is normal or not. Maybe I missed something, so any help is welcomed 🙂

---

<div class="post-metadata">

**Author:** ![pchakour](https://avatars.discourse-cdn.com/v4/letter/p/e36b37/32.png) [@pchakour](https://discuss.elastic.co/u/pchakour)\
**Post date:** [January 3, 2020, 10:37am UTC](https://discuss.elastic.co/t/pipeline-disabling/213604/2 "2020-01-03T10:37:24Z")

</div>

I'm looking in the code and I find something strange. The method terminate\_pipeline of the class PipelinesRegistry doesn't remove pipelines from memory.

```
def terminate_pipeline(pipeline_id, &stop_block)
  lock = get_lock(pipeline_id)
  lock.lock

  state = @states.get(pipeline_id)
  if state.nil?
    logger.error("Attempted to terminate a pipeline that does not exists", :pipeline_id => pipeline_id)
    @states.remove(pipeline_id)
  else
    yield(state.pipeline)
    @states.put(pipeline_id, state)
  end
ensure
  lock.unlock
end

```

So, Logstash always keep the pipeline in memory even if the pipeline is removed from the piplines.yml file. It's the expected behavior ?

For now, I did a patch to change the behavior of this method.

---

<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:** [January 31, 2020, 10:48am UTC](https://discuss.elastic.co/t/pipeline-disabling/213604/3 "2020-01-31T10:48:12Z")

</div>

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