Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fault Tolerance and Error Messaging in IPC #333

Open
tavmem opened this issue May 7, 2015 · 1 comment
Open

Fault Tolerance and Error Messaging in IPC #333

tavmem opened this issue May 7, 2015 · 1 comment

Comments

@tavmem
Copy link
Collaborator

tavmem commented May 7, 2015

This issue was raised by theosjp in the Kona-Users forum on Google Groups:

I've actually stumbled over something else

/ case 1
when an expression that is having an error is executed with a sync
remote get the client and server thread block. i am unable to recover
client session even if \e 0 is re-issued on the server.

/ case 2
when the client used the async method, the result from the remote set/get of a variable returns the previous value (indicating that the last valid expression never executed - possibly due to blocking of the thread on server till \e 0 has been issued)

/ illustration below
/ new server and client session, on server set \e 0 in each case

/ case 1

  h: 3: (`"192.168.1.12";10000) 
3 
  h 4: "2+2"  / ok 
4 
  h 4: "2+\"a\"" 
/ session hangs unable to recover 
/ \e 0 on server give "type error" but blocking on client does not clear 

/ case 2

 h: 3: (`"192.168.1.12";10000) 
3ps. 
  h 3: "r:1+3"; h 4: "r" 
4 / ok 
  h 3: "r:1+\"a\""; h 4: "r" 
4 / error - previous result returned as r is not updated 
  h 3: "r:1+42"; h 4: "r" 
4 / still previous result - expr never executed 
/ reseting \e 0 on server 
  h 3: "r:1+42"; h 4: "r" 
43 / now ok 

bakul commented on what he thought should be done about this in issue #102:

IMHO only syntactically valid message should be sent. Runtime errors have to be caught during runtime so there's nothing you can do about that on the sending side. But it does mean you should be able to report them back to the sending side. To regain control in case you sent an infinite loop you need an ability to send ^C too.

There is a warning on page 318 of the 2008 printing of "q For Mortals" by Jeffrey Borror:

"Exercise caution when sending entities to a remote server. A trivial mistake could place the server into a non-responding state."

Based on this comment, I consider this issue to be an "enhancement" rather than a "feature" that is in the scope of Version 1 of Kona.

@ghost
Copy link

ghost commented May 30, 2015

i've noticed a similar ipc issue which can cause kona to crash when a what i believe (*) is a valid expression is send via ipc, if it is not wrapped into error trap. when wrapped into error trap the client hangs.

K Console - Enter \ for help

h: 3: (`"127.0.0.1";10000);
,'$!3 / check - ok
(,[,"0";];,[,"1";];,[,"2";])
. ",'$!3" / evaluate as value
(,[,"0";];,[,"1";];,[,"2";])
h 4: ",'$!3" / eval in remote
zsh: segmentation fault rlwrap -n ./k

notes:
1/ the server was started with \e 0. hitting enter at the console after clients' segfault displays:
\e 0
syntax error

2/ when the expression in the client is wrapped with error trap the client does not crash but hangs instead:
h 4: .[{. x};",'$!3";:]
/ unable to recover, server console appears to be ok

3/ (*) - when evaluating the same expression in k2.8 results in a valence error. however, in kdb3.2 output agrees with kona:

K 2.8 2000-10-10 Copyright (C) 1993-2000 Kx Systems
Evaluation. Not for commercial use.
\ for help. \ to exit.

,'$!3
valence error
,'$!3
^
KDB+ 3.2 2014.11.01 Copyright (C) 1993-2014 Kx Systems
l32/ 2()core 3961MB theo debian-7v1 127.0.1.1 NONEXPIRE
q)
,'$!3
,'[(,"0";,"1";,"2")]

@tavmem tavmem added crash and removed crash labels Jul 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant