KDB + database death prevention due to interrupt error

If maximum memory is set using the -w command-line argument, and if a bad query is run that allocates too much memory, KDB fails with the error "-w abort".

Is it possible to force KDB to stop executing this request and not kill itself.

At least is there a callback function that kdb will call before suicide?

thank

+4
source share
1 answer

There is no callback to handle this error, unfortunately, and it is impossible to catch -w abortusing a secure evaluation. http://code.kx.com/q/ref/errors/#trap

/process 1 (setup workspace/callbacks)  
>q -w 1000 -p 4000 -e 1
q)tab:([]sym:30000000?`3;size:30000000?10f;time:30000000?.z.t)
q).z.pg:{0N!(`pg;x);@[value;x;(::)]}
q).z.exit:{'stop}
q).z.pc:{'stop}

/process 2 (issue sync request)
>q
q)(`::4000)"select from tab"
'close

/process 1 (output)
q)(`pg;"select from tab")
-w abort

. , .

. :
http://www.firstderivatives.com/downloads/q_for_gods_july_2013.pdf

+3

Source: https://habr.com/ru/post/1655659/


All Articles