Thomas Mueller created OAK-10225:
------------------------------------

             Summary: Utility to rate limit writes in case async indexing is 
delayed
                 Key: OAK-10225
                 URL: https://issues.apache.org/jira/browse/OAK-10225
             Project: Jackrabbit Oak
          Issue Type: Improvement
          Components: indexing
            Reporter: Thomas Mueller
            Assignee: Thomas Mueller


An application might writes too much stuff too quickly to the repository. In 
the extreme case, it might even write so much that the application might need 
to be stopped.

To avoid this, rate-limiting the writes would be good. For this, we can add a 
utility class with a method rateLimitWrites(), which can be called in order to 
limit the writes, in case the async indexes are lagging behind badly.

The method should return immediately if all async indexes are up-to-date 
(updated in the last 30 seconds).

If indexing lanes are lagging behind, however, the method should wait (using 
Thread.sleep) for at most 1 minute. If the method is called more than once per 
minute, it should sleep for at most the time that passed until the last call; 
that is, an application that is calling it a lot will be paused for up to 50%. 
This assumes indexes will be able to catch up in this situation.




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to