You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/11/18 12:02:51 UTC

[GitHub] [lucene-solr] dweiss commented on a change in pull request #2085: LUCENE-9508: Fix DocumentsWriter to block threads until unstalled

dweiss commented on a change in pull request #2085:
URL: https://github.com/apache/lucene-solr/pull/2085#discussion_r526032942



##########
File path: lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
##########
@@ -4258,4 +4258,47 @@ public void testPendingNumDocs() throws Exception {
       }
     }
   }
+
+  public void testIndexWriterBlocksOnStall() throws IOException, InterruptedException {
+    try (Directory dir = newDirectory()) {
+      try (IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig())) {

Review comment:
       pull it up into the same try (semicolon-separated)?

##########
File path: lucene/core/src/java/org/apache/lucene/index/DocumentsWriter.java
##########
@@ -371,19 +371,15 @@ public void close() throws IOException {
   private boolean preUpdate() throws IOException {
     ensureOpen();
     boolean hasEvents = false;
-
-    if (flushControl.anyStalledThreads() || (flushControl.numQueuedFlushes() > 0 && config.checkPendingFlushOnUpdate)) {

Review comment:
       oh, wonderful.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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