You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Copilot (via GitHub)" <gi...@apache.org> on 2026/07/23 18:27:00 UTC
Re: [PR] Improve code for java style and remove dead code [solr]
Copilot commented on code in PR #4657:
URL: https://github.com/apache/solr/pull/4657#discussion_r3640440285
##########
solr/core/src/java/org/apache/solr/filestore/DistribFileStore.java:
##########
@@ -387,7 +370,7 @@ private void distribute(FileInfo info) {
} else {
if (i == FETCHFROM_SRC) {
// This is just an optimization
- // at this point a bunch of nodes are already downloading from me
+ // at this point a bunch of nodes are already downloading from me.
Review Comment:
The comment "it's there in the memory now" is now misleading because the in-memory `tmpFiles` cache was removed in this change. Please update the comment so it matches current behavior (local on-disk availability).
##########
solr/core/src/java/org/apache/solr/filestore/DistribFileStore.java:
##########
@@ -112,13 +110,6 @@ class FileInfo {
this.path = path;
}
Review Comment:
After removing `getFileData(...)`, the `fileData`/`metaData` fields are no longer read anywhere (and the assignments in `persistToFile` only keep extra references alive). Removing them will reduce confusion and avoid retaining large buffers unnecessarily.
##########
solr/core/src/java/org/apache/solr/filestore/DistribFileStore.java:
##########
@@ -418,11 +401,7 @@ private void distribute(FileInfo info) {
.getUpdateExecutor()
.submit(
() -> {
- try {
- Thread.sleep(10 * 1000);
- } finally {
- tmpFiles.remove(info.path);
- }
+ Thread.sleep(10 * 1000);
return null;
});
Review Comment:
The cleanup task submitted in the `finally` block now only sleeps for 10 seconds and does nothing else (the former `tmpFiles` cleanup is gone). This needlessly ties up an update-executor thread and can reduce throughput if many files are distributed.
--
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-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org