mikemccand commented on a change in pull request #1361: LUCENE-8118: Throw exception if DWPT grows beyond it's maximum ram limit URL: https://github.com/apache/lucene-solr/pull/1361#discussion_r395028755
########## File path: lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java ########## @@ -219,6 +222,9 @@ final void testPoint(String message) { /** Anything that will add N docs to the index should reserve first to * make sure it's allowed. */ private void reserveOneDoc() { + if (numDocsInRAM != 0 && hardMaxBytesPerDWPT < bytesUsed()) { // TODO should we check this after each field as well to also preempt within one doc? Review comment: Could you reverse the conditional to `bytesUsed() > hardMaxBytesPerDWPT`? I think it's more quickly readable in that order? ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org