[1.1.0] IDE: Abort/Stop function using stop hotkey might leave IDE in an inconsistent state --- workaround

Bug #1267694 reported by xiaoyan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
Fix Released
Low
RaiMan

Bug Description

--- workaround ;-)
if you observe strange behaviour of the IDE after having used the stop hotkey, currently the only solution is to stop and restart the IDE

--- general advices
- long running scripts and scripts that tend to hang or loop forever should be run from command line
- use another IDE (NetBeans, Eclipse, ...)

--- reset IDE without restart
it is planned, to have a reset function in the IDE, that might help in these situations (resets the IDE to a state similar to that after startup)
This would avoid the need to stop/restart the IDE in some situations.

----------------------------------------------------------------------
sikuli version: 1.0.1
os:64bit, win7

Step:
1, Open the IDE.
2, Edit the simple py script in IDE and save it. like this.
for i in range(1,10000):
    print(i)
3, Press the key:Alt+Shift+C to stop the running script.

Expect result: The IDE will display normal and run the script again normally.

Observer result:The IDE display normal, but you could not run the script successful again. It will back to the IDE UI immediately.

Comments:
I guess we would not force stop the running thread and it will call the jython.jar's thread.
It will cause other phenomenon:It will not real stop the script successful, it will continue to execute the action when you press the stop function.

I want to know how to stop the running script successful.
Thanks for your help.

RaiMan (raimund-hocke)
summary: - Stop function is not normal
+ [1.0.1] IDE: Abort/Stop function using stop hotkey might leave IDE in an
+ inconsistent state
summary: [1.0.1] IDE: Abort/Stop function using stop hotkey might leave IDE in an
- inconsistent state
+ inconsistent state --- workaround
description: updated
description: updated
Changed in sikuli:
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → RaiMan (raimund-hocke)
RaiMan (raimund-hocke)
description: updated
Revision history for this message
RaiMan (raimund-hocke) wrote : Re: [1.0.1] IDE: Abort/Stop function using stop hotkey might leave IDE in an inconsistent state --- workaround

Until there might be another (better) method to run the scripts from inside the IDE, you have to take this into account.
There is no general solution for that.

Background:
When running a script in the IDE, the existing instance of the internally used Jython interpreter is asked to run the script via exec file() in a separate Java thread. This means, that the interpreter startup of about 3-5 seconds takes only place at the first run. Subsequent runs will start immediately.
This is seen as a convenience for the IDE users.

To abort the thread at stop hotkey press, we use thread.stop(), which is the only available option in this case. The use of this method is not recommended since it may leave instances down the line in an unstable state (which obviously is the case in the observed situations).

description: updated
RaiMan (raimund-hocke)
summary: - [1.0.1] IDE: Abort/Stop function using stop hotkey might leave IDE in an
+ [1.1.0] IDE: Abort/Stop function using stop hotkey might leave IDE in an
inconsistent state --- workaround
RaiMan (raimund-hocke)
Changed in sikuli:
milestone: none → 1.2.0
Revision history for this message
xiaoyan (xiexiaoyan-119) wrote :

Got it;
Thanks for your answer.

RaiMan (raimund-hocke)
Changed in sikuli:
milestone: 2.0.0 → none
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.