Hi Nuno,
> On 29 May 2026, at 13:30, Nuno Costa <
nunoco...@gmail.com> wrote:
>
> Hi all,
>
> We are seeing "stuck threads" as `GET /changes/?O=5000081&S=0&n=25&q=status%3Amerged&allow-incomplete-results=true`(in Javamelody) running indefinitely and increasing over time.
> This threads will stay running in the interactive-index queue as `status:merged`.
Do you have any thread dumps to share?
Did you take regular thread dumps to indentify hotspots?
> The time it stays in the queue is always changing, which indicates the task is not stuck, but running in a loop.
> In javamelody, we see that the request is always unauthenticated(anonymous).
>
> We are now able to reproduce the problem in our QA environment by accessing the UI Changes >> Merged as an anonymous user.
If anonymous users do not have permissions to see anything, then the fact that they are stuck is expected.
They are scanning through *ALL* the changes merged until they reach an empty result.
>
> The thread dumps shows that the the threads are always stuck on the Lucene index.
> Our production index size for closed changes is between 35 and 40GB.
> Gerrit home dir is based on fast NVMEs.
>
> This started to notice this problem mid-April, after the users started to lock down their project permissions and removing anonymous access.
> Since killing the task is not advised, the only option is to restart Gerrit when we reach a "stuck" task threshold and memory pressure(we have a heap of 600GB) alerts are triggered.
> In our use case, we use the interactive index queue prometheus metric and send alert when we have an average of 6 running tasks in the last 24h.
> From past occurrences, when the average increases to more that 7 tasks, the rate of stuck threads increases and memory pressure as well.
>
> We are planning to deploy the login-redirect plugin to avoid anonymous users triggering the merged changes through the UI and a custom plugin for REST API, by returning a 204 code.
Yes, that would help.
HTH
Luca.
>
> At first glance it seems that Gerrit is not able to work in a full lock down mode.
>
> Is this a bug of pagination not being applied to anonymous access, our specific setup, is working as expected/designed or something else?
>
> We see this happening in both 3.9.11 and 3.13.6.
>
> Thanks,
> Nuno
>
> --
> --
> To unsubscribe, email
repo-discuss...@googlegroups.com
> More info at
http://groups.google.com/group/repo-discuss?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
repo-discuss...@googlegroups.com.
> To view this discussion visit
https://groups.google.com/d/msgid/repo-discuss/ba9ca392-a3b4-4b5b-894d-b37b7aba1979n%40googlegroups.com.