You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Heitor Peralles <he...@gmail.com> on 2026/01/20 10:37:41 UTC

Re: (lucene) branch main updated: Monitor: Make TestCachePurging more failsafe (#15589)

How can I stop receiving these emails?

*Heitor G. Peralles*
*Direct**:* +55 21 979 661 187 <https://wa.me/5521979661187>
*Email:* heitorgp@gmail.com
*LinkedIn:* linkedin.com/in/heitorperalles
<https://www.linkedin.com/in/heitorperalles/>

On Tue, Jan 20, 2026, 07:33 <ro...@apache.org> wrote:

> This is an automated email from the ASF dual-hosted git repository.
>
> romseygeek pushed a commit to branch main
> in repository https://gitbox.apache.org/repos/asf/lucene.git
>
>
> The following commit(s) were added to refs/heads/main by this push:
>      new c440fb7ead6 Monitor: Make TestCachePurging more failsafe (#15589)
> c440fb7ead6 is described below
>
> commit c440fb7ead6c6e39b26f47115077ff306e975dc1
> Author: Alexander Reelsen <al...@spinscale.de>
> AuthorDate: Tue Jan 20 11:33:48 2026 +0100
>
>     Monitor: Make TestCachePurging more failsafe (#15589)
>
>     Add a new test for testing stats instead of hoping the assertion works
> in the
>     cache purging tests.
>
>     Closes #15587
> ---
>  .../apache/lucene/monitor/TestCachePurging.java    |  2 --
>  .../org/apache/lucene/monitor/TestMonitor.java     | 22
> ++++++++++++++++++++++
>  2 files changed, 22 insertions(+), 2 deletions(-)
>
> diff --git
> a/lucene/monitor/src/test/org/apache/lucene/monitor/TestCachePurging.java
> b/lucene/monitor/src/test/org/apache/lucene/monitor/TestCachePurging.java
> index e681d173b07..eeecd613ad9 100644
> ---
> a/lucene/monitor/src/test/org/apache/lucene/monitor/TestCachePurging.java
> +++
> b/lucene/monitor/src/test/org/apache/lucene/monitor/TestCachePurging.java
> @@ -137,8 +137,6 @@ public class TestCachePurging extends MonitorTestBase {
>          new MonitorConfiguration().setPurgeFrequency(50,
> TimeUnit.MILLISECONDS);
>      try (Monitor monitor = new Monitor(ANALYZER,
> Presearcher.NO_FILTERING, config)) {
>
> -      assertEquals(-1, monitor.getQueryCacheStats().lastPurged());
> -
>        for (int i = 0; i < 100; i++) {
>          monitor.register(newMonitorQuery(i));
>        }
> diff --git
> a/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitor.java
> b/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitor.java
> index cd75596dd4a..f4d990a5cb1 100644
> --- a/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitor.java
> +++ b/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitor.java
> @@ -253,4 +253,26 @@ public class TestMonitor extends MonitorTestBase {
>        assertEquals(0, matches.getMatchCount());
>      }
>    }
> +
> +  public void testQueryCacheStats() throws IOException {
> +    try (Monitor monitor = newMonitor()) {
> +      assertEquals(-1, monitor.getQueryCacheStats().lastPurged());
> +      assertEquals(0, monitor.getQueryCacheStats().queries());
> +      assertEquals(0, monitor.getQueryCacheStats().cachedQueries());
> +
> +      MonitorQuery[] queries =
> +          new MonitorQuery[] {
> +            new MonitorQuery("1", parse("test1")),
> +            new MonitorQuery("2", parse("test2")),
> +            new MonitorQuery("3", parse("test3"))
> +          };
> +      monitor.register(queries);
> +      assertEquals(3, monitor.getQueryCacheStats().queries());
> +      assertEquals(3, monitor.getQueryCacheStats().cachedQueries());
> +
> +      assertEquals(-1, monitor.getQueryCacheStats().lastPurged());
> +      monitor.purgeCache();
> +      assertTrue(monitor.getQueryCacheStats().lastPurged() > 0);
> +    }
> +  }
>  }
>
>

Re: (lucene) branch main updated: Monitor: Make TestCachePurging more failsafe (#15589)

Posted by Michael Sokolov <ms...@gmail.com>.
https://www.apache.org/foundation/mailinglists

On Tue, Jan 20, 2026 at 5:38 AM Heitor Peralles <he...@gmail.com> wrote:
>
> How can I stop receiving these emails?
>
> Heitor G. Peralles
> Direct: +55 21 979 661 187
> Email: heitorgp@gmail.com
> LinkedIn: linkedin.com/in/heitorperalles
>
>
> On Tue, Jan 20, 2026, 07:33 <ro...@apache.org> wrote:
>>
>> This is an automated email from the ASF dual-hosted git repository.
>>
>> romseygeek pushed a commit to branch main
>> in repository https://gitbox.apache.org/repos/asf/lucene.git
>>
>>
>> The following commit(s) were added to refs/heads/main by this push:
>>      new c440fb7ead6 Monitor: Make TestCachePurging more failsafe (#15589)
>> c440fb7ead6 is described below
>>
>> commit c440fb7ead6c6e39b26f47115077ff306e975dc1
>> Author: Alexander Reelsen <al...@spinscale.de>
>> AuthorDate: Tue Jan 20 11:33:48 2026 +0100
>>
>>     Monitor: Make TestCachePurging more failsafe (#15589)
>>
>>     Add a new test for testing stats instead of hoping the assertion works in the
>>     cache purging tests.
>>
>>     Closes #15587
>> ---
>>  .../apache/lucene/monitor/TestCachePurging.java    |  2 --
>>  .../org/apache/lucene/monitor/TestMonitor.java     | 22 ++++++++++++++++++++++
>>  2 files changed, 22 insertions(+), 2 deletions(-)
>>
>> diff --git a/lucene/monitor/src/test/org/apache/lucene/monitor/TestCachePurging.java b/lucene/monitor/src/test/org/apache/lucene/monitor/TestCachePurging.java
>> index e681d173b07..eeecd613ad9 100644
>> --- a/lucene/monitor/src/test/org/apache/lucene/monitor/TestCachePurging.java
>> +++ b/lucene/monitor/src/test/org/apache/lucene/monitor/TestCachePurging.java
>> @@ -137,8 +137,6 @@ public class TestCachePurging extends MonitorTestBase {
>>          new MonitorConfiguration().setPurgeFrequency(50, TimeUnit.MILLISECONDS);
>>      try (Monitor monitor = new Monitor(ANALYZER, Presearcher.NO_FILTERING, config)) {
>>
>> -      assertEquals(-1, monitor.getQueryCacheStats().lastPurged());
>> -
>>        for (int i = 0; i < 100; i++) {
>>          monitor.register(newMonitorQuery(i));
>>        }
>> diff --git a/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitor.java b/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitor.java
>> index cd75596dd4a..f4d990a5cb1 100644
>> --- a/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitor.java
>> +++ b/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitor.java
>> @@ -253,4 +253,26 @@ public class TestMonitor extends MonitorTestBase {
>>        assertEquals(0, matches.getMatchCount());
>>      }
>>    }
>> +
>> +  public void testQueryCacheStats() throws IOException {
>> +    try (Monitor monitor = newMonitor()) {
>> +      assertEquals(-1, monitor.getQueryCacheStats().lastPurged());
>> +      assertEquals(0, monitor.getQueryCacheStats().queries());
>> +      assertEquals(0, monitor.getQueryCacheStats().cachedQueries());
>> +
>> +      MonitorQuery[] queries =
>> +          new MonitorQuery[] {
>> +            new MonitorQuery("1", parse("test1")),
>> +            new MonitorQuery("2", parse("test2")),
>> +            new MonitorQuery("3", parse("test3"))
>> +          };
>> +      monitor.register(queries);
>> +      assertEquals(3, monitor.getQueryCacheStats().queries());
>> +      assertEquals(3, monitor.getQueryCacheStats().cachedQueries());
>> +
>> +      assertEquals(-1, monitor.getQueryCacheStats().lastPurged());
>> +      monitor.purgeCache();
>> +      assertTrue(monitor.getQueryCacheStats().lastPurged() > 0);
>> +    }
>> +  }
>>  }
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: (lucene) branch main updated: Monitor: Make TestCachePurging more failsafe (#15589)

Posted by Dawid Weiss <da...@gmail.com>.
I've unsubscribed you from commits@lucene.apache.org, I think (as a
moderator). Follow the procedure I outlined in my previous email for other
lists, please - you were subscribed using your gmail address.

D.

On Tue, Jan 20, 2026 at 12:06 PM Dawid Weiss <da...@gmail.com> wrote:

>
> We have already replied to your question, Heitor... You seem like an IT
> guy so this shouldn't be too difficult -
>
> 1) look at email headers of what address was used to subscribe to the
> mailing list, then follow -
> 2)
> https://www.apache.org/foundation/mailinglists#request-addresses-for-unsubscribing
>
> Basically, this should boil down to sending an email to:
>
> dev-unsubscribe@lucene.apache.org
> commits-unsubscribe@lucene.apache.org
>
> This should be the same email you subscribed yourself with.
>
> Dawid
>
> On Tue, Jan 20, 2026 at 11:38 AM Heitor Peralles <he...@gmail.com>
> wrote:
>
>> How can I stop receiving these emails?
>>
>> *Heitor G. Peralles*
>> *Direct**:* +55 21 979 661 187 <https://wa.me/5521979661187>
>> *Email:* heitorgp@gmail.com
>> *LinkedIn:* linkedin.com/in/heitorperalles
>> <https://www.linkedin.com/in/heitorperalles/>
>>
>> On Tue, Jan 20, 2026, 07:33 <ro...@apache.org> wrote:
>>
>>> This is an automated email from the ASF dual-hosted git repository.
>>>
>>> romseygeek pushed a commit to branch main
>>> in repository https://gitbox.apache.org/repos/asf/lucene.git
>>>
>>>
>>> The following commit(s) were added to refs/heads/main by this push:
>>>      new c440fb7ead6 Monitor: Make TestCachePurging more failsafe
>>> (#15589)
>>> c440fb7ead6 is described below
>>>
>>> commit c440fb7ead6c6e39b26f47115077ff306e975dc1
>>> Author: Alexander Reelsen <al...@spinscale.de>
>>> AuthorDate: Tue Jan 20 11:33:48 2026 +0100
>>>
>>>     Monitor: Make TestCachePurging more failsafe (#15589)
>>>
>>>     Add a new test for testing stats instead of hoping the assertion
>>> works in the
>>>     cache purging tests.
>>>
>>>     Closes #15587
>>> ---
>>>  .../apache/lucene/monitor/TestCachePurging.java    |  2 --
>>>  .../org/apache/lucene/monitor/TestMonitor.java     | 22
>>> ++++++++++++++++++++++
>>>  2 files changed, 22 insertions(+), 2 deletions(-)
>>>
>>> diff --git
>>> a/lucene/monitor/src/test/org/apache/lucene/monitor/TestCachePurging.java
>>> b/lucene/monitor/src/test/org/apache/lucene/monitor/TestCachePurging.java
>>> index e681d173b07..eeecd613ad9 100644
>>> ---
>>> a/lucene/monitor/src/test/org/apache/lucene/monitor/TestCachePurging.java
>>> +++
>>> b/lucene/monitor/src/test/org/apache/lucene/monitor/TestCachePurging.java
>>> @@ -137,8 +137,6 @@ public class TestCachePurging extends
>>> MonitorTestBase {
>>>          new MonitorConfiguration().setPurgeFrequency(50,
>>> TimeUnit.MILLISECONDS);
>>>      try (Monitor monitor = new Monitor(ANALYZER,
>>> Presearcher.NO_FILTERING, config)) {
>>>
>>> -      assertEquals(-1, monitor.getQueryCacheStats().lastPurged());
>>> -
>>>        for (int i = 0; i < 100; i++) {
>>>          monitor.register(newMonitorQuery(i));
>>>        }
>>> diff --git
>>> a/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitor.java
>>> b/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitor.java
>>> index cd75596dd4a..f4d990a5cb1 100644
>>> --- a/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitor.java
>>> +++ b/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitor.java
>>> @@ -253,4 +253,26 @@ public class TestMonitor extends MonitorTestBase {
>>>        assertEquals(0, matches.getMatchCount());
>>>      }
>>>    }
>>> +
>>> +  public void testQueryCacheStats() throws IOException {
>>> +    try (Monitor monitor = newMonitor()) {
>>> +      assertEquals(-1, monitor.getQueryCacheStats().lastPurged());
>>> +      assertEquals(0, monitor.getQueryCacheStats().queries());
>>> +      assertEquals(0, monitor.getQueryCacheStats().cachedQueries());
>>> +
>>> +      MonitorQuery[] queries =
>>> +          new MonitorQuery[] {
>>> +            new MonitorQuery("1", parse("test1")),
>>> +            new MonitorQuery("2", parse("test2")),
>>> +            new MonitorQuery("3", parse("test3"))
>>> +          };
>>> +      monitor.register(queries);
>>> +      assertEquals(3, monitor.getQueryCacheStats().queries());
>>> +      assertEquals(3, monitor.getQueryCacheStats().cachedQueries());
>>> +
>>> +      assertEquals(-1, monitor.getQueryCacheStats().lastPurged());
>>> +      monitor.purgeCache();
>>> +      assertTrue(monitor.getQueryCacheStats().lastPurged() > 0);
>>> +    }
>>> +  }
>>>  }
>>>
>>>

Re: (lucene) branch main updated: Monitor: Make TestCachePurging more failsafe (#15589)

Posted by Dawid Weiss <da...@gmail.com>.
We have already replied to your question, Heitor... You seem like an IT guy
so this shouldn't be too difficult -

1) look at email headers of what address was used to subscribe to the
mailing list, then follow -
2)
https://www.apache.org/foundation/mailinglists#request-addresses-for-unsubscribing

Basically, this should boil down to sending an email to:

dev-unsubscribe@lucene.apache.org
commits-unsubscribe@lucene.apache.org

This should be the same email you subscribed yourself with.

Dawid

On Tue, Jan 20, 2026 at 11:38 AM Heitor Peralles <he...@gmail.com> wrote:

> How can I stop receiving these emails?
>
> *Heitor G. Peralles*
> *Direct**:* +55 21 979 661 187 <https://wa.me/5521979661187>
> *Email:* heitorgp@gmail.com
> *LinkedIn:* linkedin.com/in/heitorperalles
> <https://www.linkedin.com/in/heitorperalles/>
>
> On Tue, Jan 20, 2026, 07:33 <ro...@apache.org> wrote:
>
>> This is an automated email from the ASF dual-hosted git repository.
>>
>> romseygeek pushed a commit to branch main
>> in repository https://gitbox.apache.org/repos/asf/lucene.git
>>
>>
>> The following commit(s) were added to refs/heads/main by this push:
>>      new c440fb7ead6 Monitor: Make TestCachePurging more failsafe (#15589)
>> c440fb7ead6 is described below
>>
>> commit c440fb7ead6c6e39b26f47115077ff306e975dc1
>> Author: Alexander Reelsen <al...@spinscale.de>
>> AuthorDate: Tue Jan 20 11:33:48 2026 +0100
>>
>>     Monitor: Make TestCachePurging more failsafe (#15589)
>>
>>     Add a new test for testing stats instead of hoping the assertion
>> works in the
>>     cache purging tests.
>>
>>     Closes #15587
>> ---
>>  .../apache/lucene/monitor/TestCachePurging.java    |  2 --
>>  .../org/apache/lucene/monitor/TestMonitor.java     | 22
>> ++++++++++++++++++++++
>>  2 files changed, 22 insertions(+), 2 deletions(-)
>>
>> diff --git
>> a/lucene/monitor/src/test/org/apache/lucene/monitor/TestCachePurging.java
>> b/lucene/monitor/src/test/org/apache/lucene/monitor/TestCachePurging.java
>> index e681d173b07..eeecd613ad9 100644
>> ---
>> a/lucene/monitor/src/test/org/apache/lucene/monitor/TestCachePurging.java
>> +++
>> b/lucene/monitor/src/test/org/apache/lucene/monitor/TestCachePurging.java
>> @@ -137,8 +137,6 @@ public class TestCachePurging extends MonitorTestBase
>> {
>>          new MonitorConfiguration().setPurgeFrequency(50,
>> TimeUnit.MILLISECONDS);
>>      try (Monitor monitor = new Monitor(ANALYZER,
>> Presearcher.NO_FILTERING, config)) {
>>
>> -      assertEquals(-1, monitor.getQueryCacheStats().lastPurged());
>> -
>>        for (int i = 0; i < 100; i++) {
>>          monitor.register(newMonitorQuery(i));
>>        }
>> diff --git
>> a/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitor.java
>> b/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitor.java
>> index cd75596dd4a..f4d990a5cb1 100644
>> --- a/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitor.java
>> +++ b/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitor.java
>> @@ -253,4 +253,26 @@ public class TestMonitor extends MonitorTestBase {
>>        assertEquals(0, matches.getMatchCount());
>>      }
>>    }
>> +
>> +  public void testQueryCacheStats() throws IOException {
>> +    try (Monitor monitor = newMonitor()) {
>> +      assertEquals(-1, monitor.getQueryCacheStats().lastPurged());
>> +      assertEquals(0, monitor.getQueryCacheStats().queries());
>> +      assertEquals(0, monitor.getQueryCacheStats().cachedQueries());
>> +
>> +      MonitorQuery[] queries =
>> +          new MonitorQuery[] {
>> +            new MonitorQuery("1", parse("test1")),
>> +            new MonitorQuery("2", parse("test2")),
>> +            new MonitorQuery("3", parse("test3"))
>> +          };
>> +      monitor.register(queries);
>> +      assertEquals(3, monitor.getQueryCacheStats().queries());
>> +      assertEquals(3, monitor.getQueryCacheStats().cachedQueries());
>> +
>> +      assertEquals(-1, monitor.getQueryCacheStats().lastPurged());
>> +      monitor.purgeCache();
>> +      assertTrue(monitor.getQueryCacheStats().lastPurged() > 0);
>> +    }
>> +  }
>>  }
>>
>>