Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generating pom graph locks Apache Netbeans #8209

Open
wumpz opened this issue Jan 29, 2025 · 15 comments · Fixed by #8217
Open

generating pom graph locks Apache Netbeans #8209

wumpz opened this issue Jan 29, 2025 · 15 comments · Fixed by #8217
Labels
Contribution welcome An issue or feature not currently being worked on, but a contribution would be welcomed! kind:bug Bug report or fix Maven [ci] enable "build tools" tests UI User Interface

Comments

@wumpz
Copy link
Contributor

wumpz commented Jan 29, 2025

Apache NetBeans version

Apache NetBeans 24

What happened

I tried to open the graph view for a quite large pom.xml with many transitive dependencies.

This function (displaying "loading and constructing graph ... ") locks the complete IDE. Netbeans is unusable. Now after 5min or so I have to take it down using the task manager.

I expected, that

  1. collecting data for this is done in a background thread
  2. Netbeans is not blocked the whole time
  3. maybe there is some kind of performance improvement possible

Language / Project Type / NetBeans Component

Multimodule Java Maven project

How to reproduce

Just open die Graph - View of a large pom.xml file.

Did this work correctly in an earlier version?

No / Don't know

Operating System

Windows 11

JDK

Java 21

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

No response

Are you willing to submit a pull request?

No

@wumpz wumpz added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Jan 29, 2025
@mbien
Copy link
Member

mbien commented Jan 31, 2025

I personally don't think the graph is very useful, esp for large projects where it typically fails. I would probably rather remove it and open the dependency tree.

@mbien mbien added Maven [ci] enable "build tools" tests UI User Interface labels Jan 31, 2025
@neilcsmith-net
Copy link
Member

This appears to get locked calling https://github.com/apache/netbeans/blob/master/java/java.graph/src/org/netbeans/modules/java/graph/FruchtermanReingoldLayout.java#L343 Which is called from a while (true) loop.

I think that code has logic issues that could be addressed.

@wumpz
Copy link
Contributor Author

wumpz commented Jan 31, 2025

@mbien The dependency tree displays direct and transitive dependencies without preserving the relations between those. So there is a IMHO huge benefit using the graph.

@neilcsmith-net Thx for pointing that out. I would prefer a repaired instead of a removed version. ;)

@mbien
Copy link
Member

mbien commented Jan 31, 2025

The dependency tree displays direct and transitive dependencies without preserving the relations between those. So there is a IMHO huge benefit using the graph.

those are the resolved dependencies. The graph could be replaced by a tree which shows the resolution process.

Its all already there just only on a per-dependency basis, not per project. Graphs are a nice toy until you have more than 10 nodes on your screen.

Image

@mbien mbien added Contribution welcome An issue or feature not currently being worked on, but a contribution would be welcomed! and removed needs:triage Requires attention from one of the committers labels Jan 31, 2025
@mbien
Copy link
Member

mbien commented Jan 31, 2025

Thx for pointing that out. I would prefer a repaired instead of a removed version. ;)

sure, added contribution welcome label.

@neilcsmith-net
Copy link
Member

I'm going to have a look at at least breaking out of the infinite loop for NB25. Having a button that kills the IDE is not ideal!

@neilcsmith-net
Copy link
Member

I've hopefully got a quick fix - could you check the dev build at https://github.com/apache/netbeans/actions/runs/13077814779/artifacts/2518340133 and see if it handles your project without locking up?

I can replicate your issue on a large project of my own. With this fix, the graph appears in a few seconds.

@wumpz
Copy link
Contributor Author

wumpz commented Jan 31, 2025

I tested a large project and it worked considerably faster. However, couldn't test it with my problem project. Sorry.

@mbien mbien linked a pull request Feb 1, 2025 that will close this issue
@neilcsmith-net
Copy link
Member

To clarify, that means you weren't able to test the dev build with the failing project rather than it still failed with it?

@matthiasblaesing
Copy link
Contributor

I use the graph occasionally to verify version conflicts and see how hard it will be to untangle them. So I agree with @wumpz this should not be removed.

I did a quick test with the changes from @neilcsmith-net in #8217 (thanks for taking this on) and my observation is, that the graph is much less dense. That is two sided as less nodes fit into the visible space, on the other hand the network is more readable. In the end it is "different", but good.

I agree, that usability could be better (scrolling with middle mouse button should not loose selection, zooming/moving could be improved, multiselection to rearrange groups of nodes would make it less of a hasle), but these are all not relevant here.

@mbien
Copy link
Member

mbien commented Feb 2, 2025

good to see so much renewed interest in this area, lets get this in too for NB 26 #7777 to start somewhere with the salvage operation

@mbien
Copy link
Member

mbien commented Feb 2, 2025

list with old jira duplicates #8217 (comment)

(https://issues.apache.org/jira/browse/NETBEANS-2492 not directly related but might be easy to fix)

@wumpz
Copy link
Contributor Author

wumpz commented Feb 3, 2025

@neilcsmith-net Correct. Now I am going to test the problem project.

@wumpz
Copy link
Contributor Author

wumpz commented Feb 3, 2025

@neilcsmith-net The problem project works as well. Needed a minute, but opened the graph.

@neilcsmith-net
Copy link
Member

Thanks! Yes, it's still CPU intensive, but glad it didn't lock up. I'm tempted to make that layout an option but not the default in a future release, and we probably need to find a way to make it cancellable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contribution welcome An issue or feature not currently being worked on, but a contribution would be welcomed! kind:bug Bug report or fix Maven [ci] enable "build tools" tests UI User Interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants