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 192051 - Freeze on maven project properties save
Summary: Freeze on maven project properties save
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0
Hardware: PC Other
: P2 normal (vote)
Assignee: Jesse Glick
URL:
Keywords: RANDOM, THREAD
Depends on:
Blocks: 189854
  Show dependency tree
 
Reported: 2010-11-17 12:18 UTC by Sergey Petrov
Modified: 2010-12-01 06:37 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread dump (18.76 KB, text/plain)
2010-11-17 12:18 UTC, Sergey Petrov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Petrov 2010-11-17 12:18:11 UTC
Created attachment 103031 [details]
Thread dump

Create maven web project, open project properties, go to Run section, select glassfish as a server, click in text field below, press close.
Saving will never finish, have to kill ide.
See thread dump.
Comment 1 David Konecny 2010-11-29 03:11:14 UTC
might be related to fix of issue 189854
Comment 2 David Konecny 2010-11-29 21:14:32 UTC
While retesting a different issue this deadlock happened to me several times in last 5 minutes. The scenario is: start yesterday's build with dozen of test projects of misc types and:
* open project properties of a Maven Web Project
* in Run Panel change server selection and confirm the panel
repeating these two steps twice the deadlock always seems to happen when panel is confirmed second time. HTH.
Comment 3 Jesse Glick 2010-11-29 21:22:26 UTC
Cannot yet reproduce.

Not sure if this is related to the other XAM/XDM-related hangs.

In one thread, ProjectManager.mutex is held because the project is being saved, and POMModelImpl.endTransaction is waiting for a monitor. In the other, POMModelImpl.endTransaction is already being called, and ProjectManager.mutex is requested just to find the encoding of a file, pom.xml I suppose. Not sure how XDMModel.flushDocument could fail to already have the Document in hand. Also not clear to me how both branches of actionPerformed are being executed.
Comment 4 David Konecny 2010-11-29 21:38:10 UTC
Saving of Maven project properties is mess or I'm just lazy to try to understand it. Or both. Why something has to be done in AWT thread and something in background thread? Is not it little bit too complicated?

I fixed recently http://hg.netbeans.org/web-main/rev/77dd5b4721f7 where WebRunPanelProvider was expecting that task in AWT thread is finished before background one runs. But that was not happening and assert failed randomly. My fix avoided the assert. Now I'm looking at issue 192525 which might be unrelated but: Maven pom.xml is *sometimes* not saved when project properties are closed.
Comment 5 Jesse Glick 2010-11-29 21:41:01 UTC
(In reply to comment #4)
> Or both.

:-)

> Why something has to be done in AWT thread and
> something in background thread? Is not it little bit too complicated?

It is indeed too complicated. It is a workaround for a seemingly arbitrary restriction in XAM. The lock on the POM model is acquired in EQ, and XAM refuses to let you end a transaction from a different thread. I could not find a simpler fix.
Comment 6 Jesse Glick 2010-11-29 22:06:17 UTC
I tried to fix in core-main #c371edaef3bc. Since I don't fully understand how the Maven customizer dialog works, I just rearranged some blocks of code until I found something that seems to save changes without throwing any exceptions or deadlocking. Please test.
Comment 7 David Konecny 2010-11-29 23:23:15 UTC
With your fix I cannot reproduce the deadlock anymore and it seems to resolve also my issue 192525. Brilliant! :-)
Comment 8 Quality Engineering 2010-12-01 06:37:45 UTC
Integrated into 'main-golden', will be available in build *201012010001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/c371edaef3bc
User: Jesse Glick <jglick@netbeans.org>
Log: Attempt to fix #192051 - hang saving projects.