Link to home
Start Free TrialLog in
Avatar of Gangadhara Melukote
Gangadhara MelukoteFlag for United States of America

asked on

Problem with cocurrent runtime.getRuntime.exec processes

Hi

I am executing shellscripts using runtime.getRuntime.exec method. It is taking the first request happily and allowing to do different operations on the site, but if he try to execute the second request immediately before completion of the first request of executing shell script, Server was hanging to take further requests. I am using WASCE server and Java 1.5

Any Help

Thanks
Pavan
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Same thread or separate threads?
Avatar of Gangadhara Melukote

ASKER

In Different request threads (different requests)
I think we need more info - what process, what files, etc.
A Simple Spring based Java File containing a method DStreamInstall.sh this file will be get invoked whenever a request(HTTPRequest) comes to this method .

This was under the menu called PackageInstall which will show all the  list of packages. when the user selects a package for the deployment this will invke the installDstream method that was there in the spring based java file. there in the installDstream method i am invoking the shell script DstreamInstall.sh

for the frst request to this method is doing good during the process of the first request it is not hanging at all and giving the responses for further requests if another request came in before completion of the first request(execution of the shellscript) then it is not allowing the user to do any other things.

Thanks
Pavan
I would imagine it's pretty normal that a package manager (for all sorts of reasons) would not support concurrent use
So it does not start the seocnd external process?
Or the second process never returns ?
Do you see bothe processes present if youcheck on Unix side ?
It is starting the second process as well, when the second process also running along with first process it is not allowing to do any other requests, it just hangs till the either process completes its execution
>>
It is starting the second process as well, when the second process also running along with first process it is not allowing to do any other requests, it just hangs till the either process completes its execution
>>

That's perfectly normal for a package manager. They're not designed for concurrent use since such use is normally never required
So you mean when the first is running uit allow to start the second one,
when two are running - it does not allow to start the third one?

But it waits and whjen they are completed it starts the third one ?
Yes that's right..in fact we are not able to submit any other request after second as our application  just hangs. So until on of the two started processes don't end we are not able to process anything
if you run these processs outside any java  - do you obsereve the same thing ?
yes we tried there is no problem from outside java, but if we are sending the request from the browser that to be from the same user after the second request the site was hanging
>>yes we tried there is no problem from outside java

How did you try it- what did you do?
I Just ran the shell script, i think that is your question am i correct?
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
:)