awltech / webtools-tapestry

Web Tools for Tapestry: an eclipse plugin for developping on Apache Tapestry
http://awltech.github.com/webtools-tapestry/
9 stars 5 forks source link

Tapestry Finder freezing eclipse completely #2

Closed DASXCE closed 10 years ago

DASXCE commented 10 years ago

Hello dear developer team, i hope i`m writing on the right place this issue. Forgive me for that.

Before all, this plugin is awesome, i'm thanking everyone who invested time, money and effort making this! However there is a problem, multiple machines running eclipse Kepler Service Release 1 (4.3.1) Java EE IDE for Web Developers, even running on different OS's, that have this plugin are experiencing extreme and totatly eclipse freezes, literaly! There is some progress running called Tapestry Finder for 'someAppName' and there are lots of it. ! tapestrypluginloop

I think this finder i the one finding the matching .java/.tml file, it seems it is going in some endless loop.

I can't be 100% accurate how to reproduce this but most of the time it is happening while editing some .tml file, sometimes eclipse slows done A LOT, and sometimes a can`t do nothing! a need to kill the process.

I hopet this is a minor bug and that you can solve it soon. Bye!

mvanbesien commented 10 years ago

Hello,

You are definitely writing at the right place :) And thanks for such nice feedbacks ! :)

This issue looks like something we know about, but we were not able to reproduce it....

To help us investigate on this issue, it could be great if you could share the project so we can reproduce and determine where the lock occurs. To ensure some privacy, if needed, you can send it to me directly at mvaawl@gmail.com.

Unless, we'll try to reproduce it on our side, and it may take a bit more time... In any case, we try to solve the issue as soon as possible.

Thx for trusting in us :)

BorisNaguet commented 10 years ago

Hello,

I just reproduced the issue in debug mode with 2 sample projects in my workspace.

But as the original developer of the project, here come some explanations for investigation: To make the editor work, we collect some info on the related eclipse project in a class called ProjectModel, contained in a EditedFeatureModel (related only to the opened files). Each editor has an instance of EditedFeatureModel (in TapestryMultiPageEditor.tapestryFeatureModel), created in the init() method. Now, every time the user makes a change to a file, Eclipse determines if it must rebuild the project, and if it does, it launches a POST_BUILD event that is used in TapestryMultiPageEditor.resourceChanged(), and systematically creates a new EditedFeatureModel. You must understand, that every opened editor will do that on a build! But creating it is very light, except for loading the ProjectModel that is longer (scan more or less the whole project). So this task was centralized in the TapestryCore.getProjectModel(), that has some cache and a synchronized block...

Normal behaviour is that the 1st editor that ask for it, will recreate it, put it in the cache, launch the asynch job (FeatureFinder) in a worker thread, and return, while, all the other calls arriving in the same 2 seconds will get the same instance, and don't relaunch the same job on it.

To reproduce it, I did 2 things: opening a lot of editors at the same time (well 20 seemed to be enough), and did a lot of "code-change-Ctrl-S-code-change-Ctrl-S..." to launch a lot of builds. I thought it could block in the synchronized block in TapestryCore, but it doesn't.

Instead, projectModel.loadSubFeatures() has launched a lot of FeatureFinder, and they come from different instances of ProjectModel : this is NOT NORMAL. This is the root cause on our side.

Second issue, in the stacktrace (I'll link it), we see that all these threads are locked, waiting for one of the workers. They all try to load some javadoc in JavaModelHelper.loadJavadoc(), on the line: JavadocContentAccess.getHTMLContentReader(member, true, true) calling the synchronized method JavaModelManager.intern(String s).

I don't think that we'll be able to do something for the locks in the Eclipse jdt JavaModel, so we better don't start multiple threads, and solve problem-1.

Regards

mvanbesien commented 10 years ago

Added a Scheduling Rule on Feature Finder job. This one prevents two job instances to be run concurrently. Instead, the second one is waiting for the first one to be scheduled. Committed on the trunk, and could be tested in live conditions from http://eclipse.worldline.com/nightly/webtools-tapestry

DASXCE commented 10 years ago

Dear Devs,

I'm so sorry i couldn't answer any sooner!

I will email my project to mvaawl@gmail.com.

Some additional info on how i reproduced this issue and how it is happening to me:

In my project i just open ONE .tml file with almost no content. I just do a simple control + space (a think this doesn't matter) and i add a random component, then i hit save. After that i open the progress view in eclipse and observe. First the project is building and then the event Tapestry finder... appears. First it is just one, but soon it grows to many more! The interesting thing is that, it doesn't happen on a completely new tapestry project. Because of that i'm guessing it has to do something with my project being big in case of many classes that don't have matching .tml files such as Hibernate's entity classes. Also an idea was to suspect other eclipse-tapestry plugins interfering with this but since this is not happening on new project i'm dropping this idea. I'm mentioning this because i have already a tapestry page/class switcher...

I hope this helps!

One last question... how can I install your plugin in eclipse with the new changes?

mvanbesien commented 10 years ago

Hello,

Lately, we've tried to contribute some fix for this issue. I mean try, as it was not really simple to reproduce the issue... :/. But at least we did it.

WTT is built in continuous integration... It means that as soon as we update the trunk, the update is available on an update site on the next day. Hence the fix is available already, for validation purpose.

What you have to do is

Hence, if you tell me you can't reproduce the issue anymore with the proposed fix, we'll release at least a 1.1.1 on the eclipse marketplace, with the fix to this issue.

Hoping this helps,

mvanbesien commented 10 years ago

Hello Goran (DASXCE),

Could you please confirm that even when the scanning of the whole project is enabled, the fact that we only have one Tapestry Finder running at the time is something that prevents Eclipse from freezing ?

If true, we can plan a delivery of 1.1.1 with this very fix. This would be a mid-term solution, before the delivery of a 1.2.0, that may come in more time.

Thanks a lot in advance,

Maxence

DASXCE commented 10 years ago

Hi Maxence,

Yes it is true!

When the option 'Compute Assist Contents incrementally (INCUBATION)' is unchecked there is only one instance (if i can call it like that) running in the progress view AND ECLIPSE IS NOT FREEZING! It is displaying the messages we mentioned before, and they keep looping. So it does not hang on one message!

I have actually disabled the option. I have checked the option above to use incremental computation! Because the content assist is slightly slower, but it is not a great deal... also it happened to me once that because of the Tapestry Finder my Building Workspace process would take just a little more time to finish than usual.

Since i'm talking about performance and speed this is my hardware configuration on that i'm working.

Processor : AMD dual core 2.1 GHz RAM: 2.7 GB usable

and it is a laptop.... so you see it is very low spec

I hope i helped, Bye!

On Wed, Dec 11, 2013 at 10:02 AM, Maxence Vanbésien < notifications@github.com> wrote:

Hello Goran (DASXCE),

Could you please confirm that even when the scanning of the whole project is enabled, the fact that we only have one Tapestry Finder running at the time is something that prevents Eclipse from freezing ?

If true, we can plan a delivery of 1.1.1 with this very fix. This would be a mid-term solution, before the delivery of a 1.2.0, that may come in more time.

Thanks a lot in advance,

Maxence

— Reply to this email directly or view it on GitHubhttps://github.com/awltech/webtools-tapestry/issues/2#issuecomment-30304148 .

Srdačan Pozdrav, Goran Rajta

Institute of Modern Technology Montenegro (IMTM) Programmer

CONTACT mobile: +382 68 15 07 78 url: www.imtm.me e-mail: goranrajta@gmail.com stakahop@gmail.com (personal mail address) e-mail: goran.rajta@imtm.me vladimir.stanjevic@imtm.me (IMTM office)

mvanbesien commented 10 years ago

The implementation fixing this has been delivered. Version 1.1.1 is now available on http://eclipse.worldline.com/releases/kepler/webtools-tapestry