benwtrent commented on code in PR #11923: URL: https://github.com/apache/lucene/pull/11923#discussion_r1022817060
########## lucene/core/src/java/org/apache/lucene/index/DocumentsWriterFlushControl.java: ########## @@ -85,7 +85,7 @@ final class DocumentsWriterFlushControl implements Accountable, Closeable { this.perThreadPool = documentsWriter.perThreadPool; this.flushPolicy = config.getFlushPolicy(); this.config = config; - this.hardMaxBytesPerDWPT = config.getRAMPerThreadHardLimitMB() * 1024 * 1024; + this.hardMaxBytesPerDWPT = config.getRAMPerThreadHardLimitMB() * 1024L * 1024L; Review Comment: i *think* the thing to do here would have been `Math.multiplyExact(config.getRAMPerThreadHardLimitMB(), 1024 * 1024);` It seems it's invalid if this is every more than can be contained in an integer?: https://github.com/apache/lucene/blob/b5795db0cf517f8942eed868752249df9b105603/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java#L343-L359 -- 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. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org