Forum

Kognitio Console issues, advice, etc.
Contributor
Offline
User avatar
Posts: 27
Joined: Thu Jun 26, 2014 3:23 pm

Stopping/aborting script stepping takes ages

by William » Fri Sep 12, 2014 10:53 am

Hi,

When stepping through scripts (using CTRL+T) I occasionally want to stop the stepping (using CTRL+B) to make changes and rerun a code block.
(I'm not talking about stopping scripts that are running but simply stopping the script stepping.)
For some reason to stop the script stepping I can sometimes wait for 30 seconds before being able to use Console again.
Is this a bug or is Console doing something really clever during this interval?

Thanks,

Will
Reply with quote Top
Contributor
Offline
Posts: 184
Joined: Wed May 29, 2013 2:10 pm
Location: Bracknell

Re: Stopping/aborting script stepping takes ages

by MikeAtkinson » Fri Sep 12, 2014 1:30 pm

When the abort button is pressed Kognitio Console executes a:

Code: Select all

update SYS.IPE_CURSESSIONS set ABORT=1 where SESSION=<script session>
in a temporary session.

For SQL scripts, each statement is run in turn by Console so it just waits for the ODBC call SQLExecDirectW() to complete and then stops the script, cleans up state and should then enable the Execute, Debug, etc. actions.

For Kog scripts the Lua interpreter has control and it posts callbacks to Console. So after the abort query above is executed, the Lua interpreter posts a callback to say that the next line is executing and Console is woken up. Console then checks if we have just aborted and if so stops the Lua interpreter, the Lua interpreter posts another callback to say it is stopped and Console is woken up to clean up state and should then enable the Execute, Debug, etc. actions.

It would help greatly to sort out this problem if you could supply the version of Kognitio Console you are running and the server System Version (bottom of the Kognitio Console window).
Reply with quote Top
Contributor
Offline
User avatar
Posts: 27
Joined: Thu Jun 26, 2014 3:23 pm

Re: Stopping/aborting script stepping takes ages

by William » Fri Sep 12, 2014 2:01 pm

Hi Mike,

I'm using v8.01.00-s140605 (32-bit).
It would be great to get this fixed.

Thanks,

Will
Reply with quote Top
Contributor
Offline
Posts: 184
Joined: Wed May 29, 2013 2:10 pm
Location: Bracknell

Re: Stopping/aborting script stepping takes ages

by MikeAtkinson » Fri Sep 12, 2014 3:01 pm

Is it possible the queries that take 30 seconds to abort are using Plugins that are not written by Kognitio? All Kognitio plugins have been written to play nicely with abort, but that not might be true of other plugins.

Are the queries that take 30 seconds to abort large ones that might take a long time to run (hours)?

The abort flag only works with the query actually running (sys.ipe_mysessions.command_running <> 0), if it is not running (i.e. it is waiting on the ODBC driver, or has completed) then the query cannot be aborted.

While you are waiting for the abort in another instance of Kognitio Console run:

Code: Select all

select * from sys.ipe_mysessions;
this will tell you whether the query is actually running and can be aborted.

The most likely reason for sys.ipe_mysessions.command_running = 0 is that the query has returned to the ODBC driver and this is now requesting rows. As Kognitio can produce rows much faster than they can be transmitted and processed at the client after the first row has been produced it spends most of its time waiting on the ODBC driver/client. Do you have a high value for the script max rows (Options tab, "Max rows:" input box)?
Reply with quote Top
Contributor
Offline
User avatar
Posts: 27
Joined: Thu Jun 26, 2014 3:23 pm

Re: Stopping/aborting script stepping takes ages

by William » Fri Sep 12, 2014 4:40 pm

I have the following running during the CTRL+B:

2014-09-12 16:37:26 OPEN SQL_CUR0BDE3F38 {DECLARE SQL_CUR0BDE3F38 CURSOR FOR select current_session from SYS.IPE_SYSTEM FOR READ ONLY}
2014-09-12 16:36:58 OPEN SQL_CUR02B34048 {DECLARE SQL_CUR02B34048 CURSOR FOR select * from sys.ipe_mysessions FOR READ ONLY}
2014-09-12 16:36:37 OPEN SQL_CUR029375B8 {DECLARE SQL_CUR029375B8 CURSOR FOR select S_ID, T_ID, T_NAME, T_OWNER, T_TYPE, T_CREATE_TIME, UNIQUE_COUNT, DISC_FRAG, DISTRIBUTION, CUR_SIZE, HIST_SIZE, PRIM_GROUP, IMAGE_ID from SYS.IPE_TBL_VIEW_COLUMNS3 where seq=0 at now FOR READ ONLY}

so I guess the third one is causing the problems.

I'm only returning 100 rows in my options.

Thanks,

Will
Reply with quote Top
Contributor
Offline
Posts: 184
Joined: Wed May 29, 2013 2:10 pm
Location: Bracknell

Re: Stopping/aborting script stepping takes ages

by MikeAtkinson » Mon Sep 15, 2014 11:29 am

William,

the third query is one that is made to update the metadata with all the tables and views visible to a user. It should run in the background on a different session to that in which the scripts run. I don't see how that can be the cause of the wait you are seeing. If the Kognitio database you are running against is heavily overloaded, or if your connection to it is slow then you might see short pauses in Console as it waits for things to happen - these pauses used to occur more frequently but we have moved all accesses to background threads now and given queries that potentially can run for a long time their own session.

By changing the metadata configuration option "Load schemas on connection" to be unselected, this third query should not be run. [When a schema entry is opened in the metadata tree Console will query the Kognitio database for all tables and views in the schema, which might cause a slight delay making them visible. Turning on the "Cache metadata on PC" option makes Console cache the previous tables and views in the schema, the query run when a schema is opened will update this cached information].
Reply with quote Top

Who is online

Users browsing this forum: No registered users and 1 guest

cron