[jbosstools-issues] [JBoss JIRA] (JBIDE-19184) Threadlock when JS autocomplete turned on

Victor Rubezhny (JIRA) issues at jboss.org
Fri Feb 27 08:14:49 EST 2015


    [ https://issues.jboss.org/browse/JBIDE-19184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13044651#comment-13044651 ] 

Victor Rubezhny commented on JBIDE-19184:
-----------------------------------------

Hi [~supriya.bharadwaj],

It was me who was fixing the issue.

> What actions or circumstances caused the problem?

Due to calculate Content Assist Proposals, Tooltip on a JavaScript element and/or to Validate a JavaScript code Tern.java (which usually is installed with JBT/JBDS) needs to upload all the JS files to the Tern.JS server which runs under Node.js process. The problem appears sporadically, usually on the very first usages of CA/Tooltip calculation/Validation when these actions are most likely to be performed simultaneously and (due to be done) require to upload all the required JS files to the server. If a project contains big JS files or a big number of JS files it takes a long time to upload the JS files to the Tern.JS server. Under some circumstances the uploading may stall on some request, and as result, to block the other requests.
 
> How did the problem affect the example/archetype/framework?

UI (JavaScript editor reactions) may appear to be blocked, as the Validation, Tooltip and/or Content Assist Proposals calculation couldn't be finished for a JavaScript file. There is no a common pattern of steps to reproduce. I've used angular-phonecat example project (step-12 branch) with some pretty big (>700kb) JavaScript files added to the JavaScript include path. The UI was blocked usually on a start of working with the project or after a change was done to some of big JS files (that was lead to upload that file/set of files again to Tern.JS server on order to perform a Validation, Content Assist or Tooltip calculation request).

> What was done to fix the problem?

Tern.java project has changed since the releases of v.0.6 (that was planned to be installed with JBT 4.2.3), v.0.7 and v.0.8. The current version is being developed (0.9) adds the asynchronous requests to the Tern.JS server and solves the problems of unexpected situations in communication to Tern.JS server. Because we're never aimed to use not released versions of 3-rd party products we couldn't use this version of Tern.java. So, we've contributed the changes already made in Tern.java/AngularJS-eclipse v.0.9 back into 0.8 branch and with the help of authors of Tern.java and AngularJS-eclipse projects have prepared according releases of v.0.8.2 due to use these releases with JBT 4.2.3. (we weren't able to contribute back to 0.7 branch because of too many changes and internal refactorings were done in Tern.java project since v. 0.6.0).

> What now happens to the example/archetype/framework when the same actions/circumstances occur?

If CA request to calculate proposals couldn't be finished in time, the special proposal appears instead of JavaScript proposals, no UI is being blocked as well. The special proposal tells a user that a calculation is cancelled due a timeout occurred and asks him/her to try getting the proposals later. Validation restores to work later. Tooltip doesn't appear to be shown if the calculation request is timed out. But all the functionality appears to be restored once all the required files are successfully uploaded into the server.

Hope this help.

> Threadlock when JS autocomplete turned on
> -----------------------------------------
>
>                 Key: JBIDE-19184
>                 URL: https://issues.jboss.org/browse/JBIDE-19184
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: jsp/jsf/xml/html source editing, upstream
>    Affects Versions: 4.2.2.Final
>         Environment: JBDS 8.0.2
>            Reporter: Mustafa Musaji
>            Assignee: Victor Rubezhny
>            Priority: Blocker
>             Fix For: 4.2.3.Beta1
>
>         Attachments: threaddump_jdk1.7.0_71_1422011702000.txt
>
>
> Seeing  a thread lock when using large JS projects when trying to autocomplete. Please refer to attached thread dump.



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the jbosstools-issues mailing list