You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jp...@apache.org on 2022/07/11 09:12:06 UTC

[lucene] branch main updated: add comment for no pauses in writeBytes (#1014)

This is an automated email from the ASF dual-hosted git repository.

jpountz 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 c06b98262c0 add comment for no pauses in writeBytes (#1014)
c06b98262c0 is described below

commit c06b98262c05c45b4731278880cae6baebca1407
Author: Vigya Sharma <vi...@gmail.com>
AuthorDate: Mon Jul 11 02:12:00 2022 -0700

    add comment for no pauses in writeBytes (#1014)
---
 .../core/src/java/org/apache/lucene/store/RateLimitedIndexOutput.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lucene/core/src/java/org/apache/lucene/store/RateLimitedIndexOutput.java b/lucene/core/src/java/org/apache/lucene/store/RateLimitedIndexOutput.java
index 76fa7d6056a..d5d5709bca4 100644
--- a/lucene/core/src/java/org/apache/lucene/store/RateLimitedIndexOutput.java
+++ b/lucene/core/src/java/org/apache/lucene/store/RateLimitedIndexOutput.java
@@ -70,6 +70,10 @@ public final class RateLimitedIndexOutput extends IndexOutput {
   public void writeBytes(byte[] b, int offset, int length) throws IOException {
     bytesSinceLastPause += length;
     checkRate();
+    // The bytes array slice is written without pauses.
+    // This can cause instant write rate to breach rate limit if there have
+    // been no writes for enough time to keep the average write rate within limit.
+    // See https://issues.apache.org/jira/browse/LUCENE-10448
     delegate.writeBytes(b, offset, length);
   }