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:24 UTC

[lucene] branch branch_9x 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 branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 5a4d67663ed add comment for no pauses in writeBytes (#1014)
5a4d67663ed is described below

commit 5a4d67663ed780d16a8ff57c213de5d6c52af074
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);
   }