Dead-lock while starting NetBeans#23

Labels

Milestone

Assignee

2 participants

I've recently upgraded to a newer revision of the plugin (716e795), and the custom tasks functionality seems to be broken.
I right-click on the project, select the "Custom tasks" submenu, but do not see any of my custom tasks there. Despite the tasks are defined in .nb-gradle-properties and they used to work.

Also, sometimes the plugin breaks something and Netbeans starts hanging on startup. I have to restore the IDE settings folder from time machine to bring it to life again.
Not sure if those events are related, but it seems to me that the custom tasks editing dialog causes the corruption. At least, for the last time it happened right aftter that.

To me custom tasks seem to work. Can you tell me what is your custom task definition?

Netbeans starts hanging on startup

Is this means that NetBean hangs on the splash screen? Have you used 1.1.7 as well and you did not experience it there? Anyway, it seems unlikely that the problem is related to custom tasks. Also, this seems weird because the plugin should not do anything on startup. Can you deterministically reproduce this issue on your system?

To me custom tasks seem to work. Can you tell me what is your custom task definition?

Oops... it seems I was wrong here.
My custom tasks look like this: :submodule1:gwtcompile . I expected the task would be available on every submodule node, but in fact it was available on submodule1 only.
Please disregard it, my bad.

Is this means that NetBean hangs on the splash screen?

Exactly.

Have you used 1.1.7 as well and you did not experience it there?

Not sure. This is not the first time I faced the problem, but I do not remember the conditions.

Also, this seems weird because the plugin should not do anything on startup.

I temporarily disabled the plugin by editing .netbeans/7.2/config/Modules/org-netbeans-gradle-project.xml , and that solved the problem. So this does seem to be the plugin issue.

Can you deterministically reproduce this issue on your system?

I'm trying to do that...

Also, do you have the logs of NetBeans when it hangs?

I started netbeans from command line when the problem occured, and there was nothing related in the console.
Is there any other place where I can look for netbeans logs?

For tasks to be available everywhere you should uncheck "Task must exists", otherwise the plugin only checks the selected subproject and its child projects.

On Win7 the logs are stored in C:\Users<username>\AppData\Roaming\NetBeans\7.2\var\log\messages.log. NetBeans however only keeps logs from the last three runs. On *nix, I'm not sure but probably ~/NetBeans/7.2/var/log/messages.log

I have found the logs: I backed up the netbeans home folder right before restoring it from the time machine.
However, I do not see any errors there. If you think the logs maybe useful, how can I send it?

A link to pastebin or a gist could be ok, just omit the initial enumeration of modules.

Although I have found a part which is dead-lock prone: org.netbeans.gradle.project.query.GradleSourceEncodingQuery. That is, if getEncoding is called from the EDT this method might dead-lock. I have had problems with character encoding in the past, so this is a notorious part of the code :). Anyway, the code is wrong, I will carefully examine it and will fix it.

Can you try to add a logging to this method and log if it is called from the EDT when NB hangs. So if you can reproduce the issue, you can examine the logs. I would try to reproduce the issue by "Run" the plugin, so it doesn't corrupt anything.

Unfortunately, it doesn't seem to be solved.
1. I pulled the sources and rebuilt the nbm.
2. Disabled the gradle plugin in my "bad" userdir and started Netbeans from there.
3. Closed all projects (to ensure that the issue is not project-related).
4. Uninstalled and reinstalled the plugin.
5. After restart netbeans hanged again :(

I have just realized that I forgot something ... Will fix it soon. I think after this fix I will test the plugin and will release 1.1.8 and not wait for other features I wanted to add. This is a nasty issue.