You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2023/01/13 17:27:47 UTC

[GitHub] [netbeans] mbien commented on a diff in pull request #5290: allow concurrent local indexing while downloading remote indexes.

mbien commented on code in PR #5290:
URL: https://github.com/apache/netbeans/pull/5290#discussion_r1069739838


##########
java/maven.indexer/src/org/netbeans/modules/maven/indexer/NexusRepositoryIndexerImpl.java:
##########
@@ -152,7 +153,19 @@ public class NexusRepositoryIndexerImpl implements RepositoryIndexerImplementati
     private static final HashMap<String,Mutex> repoMutexMap = new HashMap<>(4);
 
     private static final Set<Mutex> indexingMutexes = new HashSet<>();
-    private static final RequestProcessor RP = new RequestProcessor("indexing", 1);
+
+    /**
+     * Fixed to two Threads to allow concurrent remote index downloads during local indexing
+     */
+    private static final RequestProcessor RP = new RequestProcessor("maven-indexing", 2);
+
+    /**
+     * Best effort attempt to prevent two _local_ repos to be indexed at the same time to avoid unnecessary IO contention.
+     * Concurrent local+remote indexing is allowed.
+     * This isn't perfect since a download can finish before local repos finished indexing, tests showed
+     * performance doesn't degrade significantly on solid state drives.
+     */
+    private static final ReentrantLock localIndexingPermit = new ReentrantLock();

Review Comment:
   good idea!



-- 
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: notifications-unsubscribe@netbeans.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists