This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 200074

Summary: Local repo indexing should run offline
Product: projects Reporter: Jesse Glick <jglick>
Component: MavenAssignee: Jesse Glick <jglick>
Status: VERIFIED FIXED    
Severity: normal CC: mmirilovic, musilt2
Priority: P3 Keywords: PERFORMANCE
Version: 7.0   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 199481    
Attachments: Using EmbedderFactory.getProjectEmbedder() does not work

Description Jesse Glick 2011-07-12 09:50:34 UTC
Created attachment 109390 [details]
Using EmbedderFactory.getProjectEmbedder() does not work

It seems that NbIndexCreator.load makes network connections to resolve references from local POMs.
Comment 1 Jesse Glick 2011-07-25 19:34:18 UTC
The effect is to make local repo indexing unnecessarily slow, even though the disk and CPU are largely idle. Appears to especially affect things like Stapler and Hudson/Jenkins artifacts, perhaps because they declare remote repositories?
Comment 2 Jesse Glick 2011-08-09 17:22:46 UTC
core-main #f027d5143df6
Comment 3 Quality Engineering 2011-08-10 21:32:22 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/f027d5143df6
User: Jesse Glick <jglick@netbeans.org>
Log: #200074: Local repo indexing should run offline
Comment 4 Tomas Danek 2011-08-24 15:00:27 UTC
i did not observe any significant perf.improvement on indexing my local repo, but indexing works, i did not see any regression. So let me know if this is sufficient as verification, in order to be able to proceed with patch process.
Comment 5 Jesse Glick 2011-08-24 18:59:04 UTC
Ideally verification would include running e.g. Wireshark to check that no attempts are made to contact a remote repository during local repository indexing (whether or not such attempts are "fast enough" is irrelevant). However I am not entirely sure what conditions trigger the bug to begin with; it seemed that only certain artifacts were affected, probably ones with a declared remote repository (other than central).

Anyway it is the changes to NexusRepositoryIndexerImpl and MavenEmbedder which actually fix the bug; the change to EmbedderFactory is an assertion that no remote repository is contacted on behalf of the offline embedder. That assertion is in fact triggered if the other changes are reverted; I would not include the EmbedderFactory change in a backported patch for fear of causing some regression.
Comment 6 Jesse Glick 2011-08-25 16:23:12 UTC
Simplified backport: releases #342d50cdb6ce
Comment 7 Quality Engineering 2011-08-26 04:27:39 UTC
Integrated into 'releases'
Changeset: http://hg.netbeans.org/releases/rev/342d50cdb6ce
User: Jesse Glick <jglick@netbeans.org>
Log: #200074: Local repo indexing should run offline
(Simplified patch adapted from f027d5143df6.)
Comment 8 Quality Engineering 2011-09-26 13:35:58 UTC
Integrated into 'releases'
Changeset: http://hg.netbeans.org/releases/rev/5bbccc2894f7
User: Jesse Glick <jglick@netbeans.org>
Log: #200074: Local repo indexing should run offline
(Simplified patch adapted from f027d5143df6.)