[hunchentoot-devel] hunchentoot and sb-ext:run-process experiences

Nicolas Neuss neuss at math.uni-karlsruhe.de
Thu Jun 11 10:18:05 UTC 2009


Cyrus Harmon <ch-tbnl at bobobeach.com> writes:

> Today I figured out that if I manually close the process, bad things  
> happen a lot less frequently. This may seem obvious, 

Indeed - and I have been bitten by this too (I figured it out myself some
months ago).  So, although obvious, it could be very helpful for some
people that you report it here.

> but if after calling sb-ext:run-program I make an unwind-protect block
> and call sb- ext:process-wait and sb-ext:process-close, things get a lot
> better. I guess I should have suspected that something like this might
> have been the problem when I had errors such as:
>
> [2009-06-10 20:37:03 [ERROR]] The value 1026 is not of type (MOD 1025).

How do you do the whole construct?  I must admit that I did not use
UNWIND-PROTECT for my fix.  Probably, the right thing is not to use
run-program in such cases at all, but introduce a wrapper macro for SBCL
(this should therefore be more appropriate for the SBCL list to which I CC
this as well).

For example, see the Allegro CL documentation:

"The :osi module (see Operating System Interface Functionality in
 os-interface.htm) has these new operators relating to running
 subprocesses: the function command-output and the macros
 with-command-output and with-command-io. They are higher-level than
 run-shell-command and shell and are now recommended when the interaction
 with the subprocess requires input or produces output that must be
 captured."

Nicolas




More information about the Tbnl-devel mailing list