# When does the pending count become 0

**URL:** https://discuss.elastic.co/t/when-does-the-pending-count-become-0/313649
**Category:** Beats
**Tags:** filebeat
**Created:** [September 5, 2022, 7:19am UTC](https://discuss.elastic.co/t/when-does-the-pending-count-become-0/313649 "2022-09-05T07:19:07Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![hanhee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hanhee/32/121853_2.png) [@hanhee](https://discuss.elastic.co/u/hanhee)
#### Post date: [September 5, 2022, 7:19am UTC](https://discuss.elastic.co/t/when-does-the-pending-count-become-0/313649/1 "2022-09-05T07:19:07Z")

</div>

hi I do not speak English well. sorry  
my servers log file create 100/1min every day and delete all 12:00 pm  
but registry json not show flag "remove" and log.json, number.json just keeps getting bigger.  
i wonder When does the 'store' pending count become 0  
my server is os : centos7 with filebeat 8.4 and use filesteam  
and i complied source filebeat gitbub.

filebeat/input/filestream/internal/input-logfile/store.go

------------org-------------------

```auto
func (r *resource) Finished() bool { return r.pending.Load() == 0 }

```

------------modify--------------

```auto
func (r *resource) Finished() bool {
              fmt.Println(r.pending.Load()) 
              return r.pending.Load() == 0 }

```

and  
i removed file or dir  
but r.pending.Load is not 0, it is 2  
and no matter how much time passes ,it does not change 0

So nothing was deleted when clean.go

i wonder what module is clean or update store instance

---

<div class="post-metadata">

### Author: ![mtojek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mtojek/32/63863_2.png) [@mtojek](https://discuss.elastic.co/u/mtojek)
#### Post date: [September 5, 2022, 2:53pm UTC](https://discuss.elastic.co/t/when-does-the-pending-count-become-0/313649/2 "2022-09-05T14:53:11Z")

</div>

Please share the configuration you're using.

---

<div class="post-metadata">

### Author: ![hanhee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hanhee/32/121853_2.png) [@hanhee](https://discuss.elastic.co/u/hanhee)
#### Post date: [September 5, 2022, 5:36pm UTC](https://discuss.elastic.co/t/when-does-the-pending-count-become-0/313649/3 "2022-09-05T17:36:23Z")

</div>

i used when testing

```auto
- type: filestream
  paths:
    - /home/test/file/*
  ignore_older: 4m
  close.reader.on_eof: true

```

or

```auto
- type: filestream
  paths:
    - /home/test/file/*
  ignore_older: 4m
  close.reader.on_eof: true
  close.on_state_change.removed: true
  clean_remov: true

```

---

<div class="post-metadata">

### Author: ![hanhee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hanhee/32/121853_2.png) [@hanhee](https://discuss.elastic.co/u/hanhee)
#### Post date: [September 16, 2022, 12:36am UTC](https://discuss.elastic.co/t/when-does-the-pending-count-become-0/313649/4 "2022-09-16T00:36:58Z")

</div>

hi @mtojek

i have question about this  
i used config that **close.on\_state\_change.inactive: 2m**

1. when stop hvester due to config, why **store** memmory ttl is 1800000000000  
(when stop havester, All actions are normal(transport logstash)

2. when will it change ttl is '0' after stop havester

3. If ttl is non-zero store's Pendding increases and ttl is changed to 0 when calling delete method due to **clean removed** ( pendding: 2, ttl=0)  
then what schedule or condition is the store memory deleted?

---

<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: [October 14, 2022, 2:37am UTC](https://discuss.elastic.co/t/when-does-the-pending-count-become-0/313649/5 "2022-10-14T02:37:26Z")

</div>

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