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 253984 - Stopping the current search does not stop it
Summary: Stopping the current search does not stop it
Status: REOPENED
Alias: None
Product: connecteddeveloper
Classification: Unclassified
Component: Jira (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-30 10:33 UTC by stwr
Modified: 2015-09-02 14:54 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Never ending server data retrieval (12.42 KB, image/png)
2015-07-30 10:40 UTC, stwr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description stwr 2015-07-30 10:33:07 UTC
Product Version: NetBeans IDE 8.1 Beta (Build 201507282201)
Java: 1.8.0_60-ea; Java HotSpot(TM) 64-Bit Server VM 25.60-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_60-ea-b25
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
User directory: C:\Users\cendrowiczm\AppData\Roaming\NetBeans\8.1beta
Cache directory: C:\Users\cendrowiczm\AppData\Local\NetBeans\Cache\8.1beta

--Use Case--

1. Execute the 'Create Query' action by right-clicking on certain JIRA node in the Tasks/Repositories view
2. Provide some criteria and hit the 'Search' button
3. Cancel the current search by clicking on small close button in the status bar, hit 'Yes' when asked to confirm the cancellation
4. Hit the 'Search' button one more time 

--Expected result--

New search is started.

--Actual result--

Nothing happens. At least this is what the user can see. No new search is started.

--Actual result cont'd--

I observed several different strange behaviors.

The very first was that after I hit the 'Search' button one more time when actually nothing happened (4. step) the IDE displayed result of the search for really short while. This result came up after quite long time, up to 4 minutes. Immediately after the result was gone and the IDE behaved like it behaves when user clicks the 'Search' button - the 'Search' button become the disabled state and the status bar contained new search progress bar.
The conclusion is clear for me - the first search has not been cancelled when I did it in status bar (3. step). The search was continued in the background. When the result was ready it was displayed. Immediately after my second search has been started (4. step). It seems that my second search was still waiting.
Comment 1 stwr 2015-07-30 10:40:12 UTC
Created attachment 155045 [details]
Never ending server data retrieval

Things are getting MUCH MORE complicated when there are several server-side queries synchronized with particular JIRA repository. Search performed by IDE for single query behaves exactly the same. It is continued in the background.
I can cancel it whenever I want (using status bar) and for the first look it looks OK. But after some time this query gets an update (number of tickets returned is displayed next to query name).

What is more searches performed for these queries have impact on 'Create Query' feature. When such search is performed in the background (but should be cancelled) there is no way to start new search from 'Create Query' described in the previous comment. Only when background search is finished the IDE starts to process my submit - button gets disabled a.s.o.

Reassuming - it is extremely easy to submit many of searches which are waiting for each other. Currently when I am typing this description the IDE performs 'Create Query' search submitted by me 20 minutes ago.
Comment 2 stwr 2015-07-30 10:44:07 UTC
The use case from my first comment can be also enhanced by following step:

5. Perform 'Reload Attributes'

--Actual result--

Please see the picture 'Never ending server data retrieval'. Normally the server data is being reloaded quick. But this time I guess it is waiting until the first search is finished. But it will have to wait even longer because there is second search submitted.
Comment 3 stwr 2015-07-30 12:39:47 UTC
I also realized that the stopping of current search works perfectly good when working against NetBeans Bugzilla repository. The IDE is fully responsible. I can cancel the search and start the next one immediately after.
Comment 4 stwr 2015-07-30 13:35:00 UTC
Like I already commented the server-side queries (or filters) behave the same. 

--Use case too reproduce--

1. Refresh one of server-side queries, right-click->Refresh or F5
2. Cancel the just started search task via status bar
3. Repeat 1. step

--Actual result--
The server-side query becomes waiting icon next to it. There is NO progress bar in status bar for new search.
After some time (when 1. query is completed, depends on amount of items) new search task appears in the status bar.

Again it looks like the 1. search was still continued in the background and was blocking the 2. search.
Comment 5 Tomas Stupka 2015-08-27 15:01:15 UTC
what connector do you use? (see options > team > tasks)
Comment 6 Tomas Stupka 2015-08-27 15:01:59 UTC
observed some strange behavior, but hard to reproduce  ...
Comment 7 stwr 2015-08-27 15:27:11 UTC
I was using JIRA 5.0+ when doing all these tests.
Comment 8 Tomas Stupka 2015-08-27 15:47:12 UTC
fixed in jet-main #346d6987a826
Comment 9 Tomas Stupka 2015-08-27 15:47:53 UTC
looking on the code, some things were definitely wrong. 
fixed that and after a few tries wasn't able to reproduced into the described behavior, but like mentioned - it was not so easy for me to reproduce. feel free to reopen in case it still occures.

the actuall plugin version is 1.58
Comment 10 stwr 2015-08-28 08:14:27 UTC
Is the 1.58 published already? The JIRA plugin appears still in the 1.57 in the Plugins section. The update check also does not recognize new version.
Comment 11 Tomas Stupka 2015-08-28 08:34:27 UTC
(In reply to stwr from comment #10)
> Is the 1.58 published already? The JIRA plugin appears still in the 1.57 in
> the Plugins section. The update check also does not recognize new version.
it might take a while ...
Comment 12 Quality Engineering 2015-08-29 03:03:04 UTC
Integrated into 'main-silver', will be available in build *201508290002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/346d6987a826
User: Tomas Stupka <tstupka@netbeans.org>
Log: Issue #253984 - Stopping the current search does not stop it
Comment 13 stwr 2015-08-30 14:00:38 UTC
Hi Tomas,

unfortunately I have not realized any difference :/. I recorded the video for you [1], and I hope you are able to watch it (you may wait until it gets better quality, or just download it).

--Most important facts--
1. 00:30 I am starting the first search
2. 00:34 I am cancelling the first search
3. 00:35 I am starting the second search
4. 00:35 - 01:13 Nothing happens
5. 01:13 It seems that the second search (started at 00:35) is started now
6. 01:19 I am trying to cancel the second search (and I am not able to cancel it until end of the movie)
7. 01:58 Search result comes up

I think that 01:13 is the time when first result of first query arrives and this is also the time when the IDE actually cancels the first query. The first query has not been cancelled at 00:34 :/.

[1] https://drive.google.com/file/d/0BwhUh4K0njs_Y3pGU2xuOG83cW8/view?usp=sharing

--Tested on--
Product Version: NetBeans IDE Dev (Build 201508300002)
Java: 1.8.0_60-ea; Java HotSpot(TM) 64-Bit Server VM 25.60-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_60-ea-b25
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
User directory: C:\Users\cendrowiczm\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\cendrowiczm\AppData\Local\NetBeans\Cache\dev
Comment 14 Tomas Stupka 2015-09-02 14:54:37 UTC
two problems to deal with:
- the rest client doesn't react to .interrupt() once it is in io - step 2.) 
- ugly after effects in steps 3. - 7.)