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 182646 - Deadlock after making project sharable
Summary: Deadlock after making project sharable
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSF (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-24 10:01 UTC by Petr Jiricka
Modified: 2010-03-29 05:26 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread dump (30.99 KB, text/plain)
2010-03-24 10:01 UTC, Petr Jiricka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2010-03-24 10:01:38 UTC
Created attachment 95656 [details]
Thread dump

I created a web project and then went throigh the Make Sharable wizard by specifying the Libraries folder, and ran into this deadlock.
Comment 1 David Konecny 2010-03-25 02:28:31 UTC
Likely caused by fix of issue 180468. Code is not easy to follow - I've started refactoring it. There seems to be too much listening on file changes and current synchronization is redundant as well.
Comment 2 David Konecny 2010-03-26 03:27:37 UTC
The initial refactoring I've started ended up with almost complete rewrite of two classes involved - ModelUnit and JsfModelImpl. I tested it on in several scenarios including one from issue 180468 and everything seems to be working according to JSF spec. Code is more readable, perform better and couple of corner cases are handled correctly compared to previous version.

One thing I wonder Marek is that JsfModel has property change listening support but (and I might be wrong) I did not find anybody listening on the changes. Maybe it is not necessary to listen on changes in JsfModel and instead always ask for current value as needed? On the other hand if I start IDE and start code completion for in EL while IDE is still starting up then I'm given "No Suggestions" instead of "Please Wait".

426a58799988
Comment 3 Marek Fukala 2010-03-26 08:23:59 UTC
> One thing I wonder Marek is that JsfModel has property change listening support
> but (and I might be wrong) I did not find anybody listening on the changes.
> Maybe it is not necessary to listen on changes in JsfModel and instead always
> ask for current value as needed? On the other hand if I start IDE and start
> code completion for in EL while IDE is still starting up then I'm given "No
> Suggestions" instead of "Please Wait".
> 
> 426a58799988

I'm not caching the data from JsfModel in any way so I do not think I should use the listeners. The completion always calls MetadataModel.runReadAction() and call getElements() inside.

The bahaviour I would expect is that <T extends JsfModelElement> List<T> getElements( Class<T> clazz) is blocking if there model is not initialized yet and/or the scanning is in progress.

Possibly it could be fixed by adding the "wait classpath scan finished" before the model access.

The listeners would probably make sense if there was some kind of higher level model build on top of the JsfModel which would require to be synced, something like a visual editor which incorporates the metamodel data. 

Ads would know more.
Comment 4 Marek Fukala 2010-03-26 08:26:20 UTC
OTOH I didn't check how fast/slow is the getElements() itself. If the model doesn't cache the data itself and always do the analysis it would be worth of caching the metadata for example in the JSFBeanCache (which doesn't cache anything right now) and flush the cache upon the model's property change.
Comment 5 David Konecny 2010-03-29 05:26:08 UTC
Fixing failing unit tests (some code was wrong and some tests needed to be fixed): 0316c07a890b 6f4b3c4a45a6