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 200263

Summary: Transferring Maven repository index should not block code-complete
Product: projects Reporter: _ gtzabari <gtzabari>
Component: MavenAssignee: Milos Kleint <mkleint>
Status: RESOLVED FIXED    
Severity: normal CC: exceptions_reporter, jglick, jtulach, pjiricka, rptmaestro, vanob
Priority: P3 Keywords: PERFORMANCE
Version: 7.0.1   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 209856    
Bug Blocks:    
Attachments: Thread dump

Description _ gtzabari 2011-07-20 14:52:36 UTC
"Transferring Maven repository index" takes over 20 minutes on my computer. Granted, this doesn't happen often but it is extremely painful. Every time I install a new dev build I wipe my userdir and then I'm out of commission for at least 30 minutes where I can't do any work.

This applies (but to a lesser degree) for the "indexing local maven repository" task which also takes a long time (5+ minutes).

Expected behavior: Use the existing repository index (or an empty set) until the new index is ready. It isn't reasonable to block code-complete for more than 10 seconds at a time.
Comment 1 Jesse Glick 2011-07-20 16:37:48 UTC
(In reply to comment #0)
> "Transferring Maven repository index" takes over 20 minutes on my computer.

Are you using a local/nearby mirror? If not, you should be. For example: http://wiki.netbeans.org/FaqNexus

> Every time I install a new dev build I wipe my userdir

Probably better to leave var/cache/mavenindex/ at least.

> Use the existing repository index (or an empty set) until
> the new index is ready.

The question is what should be shown that would indicate that the results are incomplete. For example, if you invoke CC on project/build/plugins/plugin/artifactId with groupId already set to org.apache.maven.plugins, and the Central index is not ready, it would be misleading to show an empty list.

A related question is what _should_ trigger indexing. Probably the explicit search dialogs such as for Add Dependency ought to. It may also be feasible for CC in a POM to trigger indexing but not wait for it to finish, so that the same CC a few minutes later would give full results.
Comment 2 _ gtzabari 2011-07-20 17:35:39 UTC
Jesse,

> Are you using a local/nearby mirror? If not, you should be. For example:
http://wiki.netbeans.org/FaqNexus

At last check I am already getting 100k/s so I don't think using mirrors will help much. The process is slow. It probably always will be (again, I am expecting 10 seconds or less).

> The question is what should be shown that would indicate that the results are
incomplete.

The status bar already provides a some indication of stale data. For example, I know that if there is any ongoing indexing operation (whether Maven or "checking external file changes") my search results are likely out of date.

I suggest that if the cache is older than the time Netbeans was launched then simply add the following notice the bottom of code-complete windows: "WARNING: Netbeans is in the process of updating the index."
Comment 3 Milos Kleint 2012-03-16 09:45:24 UTC
http://hg.netbeans.org/core-main/rev/2809e8de3470
http://hg.netbeans.org/core-main/rev/ec2936361b1e

make all queries into repository indexes non blocking. CC and other UIs will show when results are not complete. No effort is made to eventually return the complete results eventually, leaving it to the user to retry the UI gesture.

only QueryRequest-based code will currently show nothing, I'm not entirely sure if we should
1. enhance the UI to show info about partial results
2. make these queries blocking and wait for the finish of indexing
3. remove the class entirely and use the same non-blocking queries as elsewhere.
Comment 4 Quality Engineering 2012-03-17 10:39:56 UTC
Integrated into 'main-golden', will be available in build *201203170400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/2809e8de3470
User: Milos Kleint <mkleint@netbeans.org>
Log: #200263 make all queries into index non blocking when the index is being updated. just skip the given index, show in various UIs.
Comment 5 Jesse Glick 2012-03-26 23:05:23 UTC
*** Bug 192628 has been marked as a duplicate of this bug. ***
Comment 6 Jesse Glick 2012-03-26 23:05:42 UTC
*** Bug 184278 has been marked as a duplicate of this bug. ***
Comment 7 Jesse Glick 2012-03-26 23:13:04 UTC
*** Bug 205174 has been marked as a duplicate of this bug. ***
Comment 8 Jesse Glick 2012-03-26 23:13:21 UTC
*** Bug 205153 has been marked as a duplicate of this bug. ***
Comment 9 Jesse Glick 2012-03-26 23:16:10 UTC
*** Bug 201835 has been marked as a duplicate of this bug. ***
Comment 10 Jesse Glick 2012-03-28 23:43:53 UTC
Is this now FIXED?
Comment 11 Milos Kleint 2012-03-30 11:07:56 UTC
I suppose it is.
Comment 12 vanob 2012-06-15 10:53:43 UTC
I encountered this with build 201206150001.
I've started with empty userdir and this task has been running for at least 15 minutes (20% right now)
Comment 13 vanob 2012-06-15 10:56:45 UTC
Created attachment 120896 [details]
Thread dump
Comment 14 Milos Kleint 2012-06-15 11:38:54 UTC
vanob: the stacktrace attached is not from the IDE, but most likely grizzly. You also haven't mentioned if just the task is taking long (which is more than likely and not inherently incorrect) or if code complete is blocked by the task.
Comment 15 vedantydv123 2019-07-19 09:56:41 UTC
No, there is a checkbox for Passive mode in the dialog. In https://abc2xyz.co/asdfghj your screenshot it is not visible, you must scroll down. Attaching screenshot of the FTP configuration.