Greetings,
I am in the process of embedding ABCL into a web server application I have. While it is okay for an error to either be caught and handled, or not handled and having the thread terminate, it definitely is not okay for an error condition to kill the entire server.
I am executing a (load "file") command (where "file" doesn't exist) from Java and it kills the entire server. I tried enclosing it in a try/catch block (I tried Exception & Throwable) and it still killed the server.
I then replaced the load with (without a try/catch):
File file = null; file.canRead();
And the error didn't kill the server. I just got a backtrace and the thread ended. (I think the error was caught higher up.)
Is ABCL calling System.exit() or doing something similar?
Thanks.
Blake McBride
Hi Blake,
I am in the process of embedding ABCL into a web server application I have. While it is okay for an error to either be caught and handled, or not handled and having the thread terminate, it definitely is not okay for an error condition to kill the entire server.
I am executing a (load "file") command (where "file" doesn't exist) from Java and it kills the entire server. I tried enclosing it in a try/catch block (I tried Exception & Throwable) and it still killed the server.
That's not very nice indeed. Because of your report, I checked our use of System.exit(). Fortunately its use is limited: once in Autoload.java, which should probably be replaced by something not as drastic (how about IrrecoverableSituationException?) and once by Interpreter.java. Unfortunately, the latter is in a function called kill() which also has two usages. The main use being in a function called Lisp.exit(). That function unfortunately has 13 uses.
Those will need to be reviewed and replaced one by one. I'll have a look.
I then replaced the load with (without a try/catch):
File file = null; file.canRead();
And the error didn't kill the server. I just got a backtrace and the thread ended. (I think the error was caught higher up.)
Is ABCL calling System.exit() or doing something similar?
Are there any other forbidden functions for "well behaving" libraries?
Regards,
Erik.
On Thu, Jan 13, 2011 at 2:59 PM, Erik Huelsmann ehuels@gmail.com wrote:
Hi Blake,
I am in the process of embedding ABCL into a web server application I have. While it is okay for an error to either be caught and handled, or not handled and having the thread terminate, it definitely is not okay for an error condition to kill the entire server.
I am executing a (load "file") command (where "file" doesn't exist) from Java and it kills the entire server. I tried enclosing it in a try/catch block (I tried Exception & Throwable) and it still killed the server.
[...]
Are there any other forbidden functions for "well behaving" libraries?
Not that I can think of. Thanks!
Regards,
Erik.
On second thought, if Java has anything like (I'm mainly from the C world) flush all buffers, close all files, hold other threads, etc. could be a problem too.
On Thu, Jan 13, 2011 at 3:08 PM, Blake McBride blake@mcbride.name wrote:
On Thu, Jan 13, 2011 at 2:59 PM, Erik Huelsmann ehuels@gmail.com wrote:
Hi Blake,
I am in the process of embedding ABCL into a web server application I have. While it is okay for an error to either be caught and handled, or not handled and having the thread terminate, it definitely is not okay for an error condition to kill the entire server.
I am executing a (load "file") command (where "file" doesn't exist) from Java and it kills the entire server. I tried enclosing it in a try/catch block (I tried Exception & Throwable) and it still killed the server.
[...]
Are there any other forbidden functions for "well behaving" libraries?
Not that I can think of. Thanks!
Regards,
Erik.
On Thu, Jan 13, 2011 at 10:14 PM, Blake McBride blake@mcbride.name wrote:
On second thought, if Java has anything like (I'm mainly from the C world) flush all buffers, close all files, hold other threads, etc. could be a problem too.
Right. Java has a "hold other threads" but the API has been deprecated and isn't used by ABCL. I'm not aware we use any other functions which change global state.
Bye,
Erik.
On Thu, Jan 13, 2011 at 9:59 PM, Erik Huelsmann ehuels@gmail.com wrote:
Are there any other forbidden functions for "well behaving" libraries?
Most of those that change global state: System.setIn/setOut, for example, or the API for setting the HTTP proxy. But I doubt ABCL uses any of those.
armedbear-devel@common-lisp.net