2012/11/23 Christopher Schultz <ch...@christopherschultz.net>:
> On 11/21/12 4:42 AM, Andrei Petru Mura wrote:
>> TheProcessing.logoutSubscriberByMac(mac) has that code on it:
>>
>> public static void logoutSubscriberByMac(String mac) { try {
>>
>> Process proc = Runtime.getRuntime().exec("logout subscriber
>> command"); proc.waitFor(); //here is the problem
>
> You almost certainly have a problem with stream management: if you
> don't drain both the output stream and error stream of the process,
> then your code can hang. Likewise, if you don't close the standard
> input stream to the process, the child process may block waiting for
> input.
>
> It sounds silly, even if you use little or no standard input or output
> from your child process, but failure to manage these streams can and
> will hang up your Java code.
>
> You can either write multi-threaded code to handle all these streams,
> or you can use one of the several high-quality utility libraries out
> there that can wrap Runtime.exec for you and take care of this kind of
> stuff.
>

+1.

There was also such thread in June as
"Issue with keep-alive connections, when using APR Connector on
Windows and starting Processes from Servlets" where some JRE bugs were
mentioned.

http://markmail.org/thread/hsime5ayjdrg4fwm

I do not know much about your configuration to tell whether this is
affecting you or not.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to