[kepler-dev] Combining the CommandLine and Exec actors

bilsay@sdsc.edu bilsay at sdsc.edu
Fri Jun 17 18:48:36 PDT 2005


Hi Dan,

I started to write some code yesterday and there are a few things related
to what you said and some other features of the new combined actor.
Actually I can say that the actors are combined.I mean CommandLine can
also do what Exec does.Now I am dealing with new features.I am considering
your and Christophers ideas on how to develope the actor.


> The I/O threads (gobblers) were borrowed (I think) from an article in
> JavaWorld; they were added specifically for Windows since apparently the
> internal buffers used by the Windows commandline/shell were too small
> and often overflowed. They are probably not needed for Unix systems (and
> maybe not even for the latest versions of Windows). It is probably still
> a good idea to use them to avoid problems.
>
First I tought gobblers would solve the problem of hanging.They didn't.
Then I tried to flush the buffers because as you said there are bounded
buffer sizes for stdout and stderr.Even I directed the streams to files
but still 'java' command doesn't work while javac has no problem.'java'
command locks the keyboard.I don't why it is still happening even I did
everything.I think I have to check the code again.

> Finally, one option that I don't think we have considered in Exec or
> CommandLine is to launch a process and NOT wait for it to complete.
> (Currently I think we always use a 'waitFor()' method). This would be
> primarily of use for launching completely different applications for
> output/display at the end of a Kepler workflow. There are some occasions
> when this would be useful.

You mean once you get the output you can terminate the process?
So in this case I am thinking of what Christopher said.What about when the
process gives output in every 30 seconds.The actor gives stdout after it
terminates.As you are saying, it waits for('waitFor() is used) the process
to end.I am thinking of checking buffers while process is still running
but in which intervals?(maybe in loop it can check constantly,I don't
know)

There are some other details.
*Christopher mentioned about bad signals and I suggested using Key
Listeners but when I thought about it today I realized that do we really
need to handle this case? When we use the Interactive shell actor I think
it is that actors duty to handle this.(and actually this is very easy
maybe InteractiveShell should be modified) If there comes unexecutable
commands I think these are just errors.It is not possible for
InteractiveShell to pass ctrl-c to CommandLine.
*There some other issues like preserving the environment and directory
which I am also working on.
*One interesting thing is that when I was trying to add a shell parameter
which would let us to execute /bin/sh commands under windows I don't know
how but by mistake I think I did the first command shell which can execute
both cmd.exe and /bin/sh scripts.But since I know that it works I will try
to fix it.
*Stderr reporting which I don't know why it doesn't do.I don't think it is
an hard issue.That would be fine.

I thinks this is all.As I said two actors are combined but I am working on
other additional ideas.Thanks for your suggestions and support.

Bilsay


More information about the Kepler-dev mailing list