You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Robert Melfing <ro...@gmail.com> on 2010/09/16 23:00:24 UTC

ExternalProcesses issue

Hi all,

[and thanks for the great job!]

Quick one about External Processes:
I've done a dummy java program to test this feature.
An infinite loop on readline() to printout what's passed in.

But when I either stop or restart couchdb, my java process is never killed
and keeps running.

Should the external process exit() after each request? Or can it stay 
running,
waiting for the next request?

env:
Ubuntu Karmic, couch 1.0.1

local.ini:
[external]
test=java -jar /TestExtrernalProcesses/dist/TestExtrernalProcesses.jar

[httpd_db_handlers]
_test = {couch_httpd_external, handle_external_req, <<"test">>}


cheers,
Robert

Re: ExternalProcesses issue

Posted by Paul Davis <pa...@gmail.com>.
On Thu, Sep 16, 2010 at 5:00 PM, Robert Melfing
<ro...@gmail.com> wrote:
> Hi all,
>
> [and thanks for the great job!]
>
> Quick one about External Processes:
> I've done a dummy java program to test this feature.
> An infinite loop on readline() to printout what's passed in.
>
> But when I either stop or restart couchdb, my java process is never killed
> and keeps running.
>
> Should the external process exit() after each request? Or can it stay
> running,
> waiting for the next request?
>
> env:
> Ubuntu Karmic, couch 1.0.1
>
> local.ini:
> [external]
> test=java -jar /TestExtrernalProcesses/dist/TestExtrernalProcesses.jar
>
> [httpd_db_handlers]
> _test = {couch_httpd_external, handle_external_req, <<"test">>}
>
>
> cheers,
> Robert
>

Robert,

You need to observe proper unix semantics and exit the program when
stdin closes. Alternatively, if Java has API's for getting the parent
process id, you can use that as well for an indication on when to
close.

HTH,
Paul Davis