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
Gangadhara MelukoteAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
CEHJConnect With a Mentor Commented:
If it *does* support concurrent use (i'd be surprised) then make sure you're handling Runtime.exec (not trivial) correctly. See

http://technojeeves.com/joomla/index.php/free/52-runtimeexec
0
 
CEHJCommented:
Same thread or separate threads?
0
 
Gangadhara MelukoteAuthor Commented:
In Different request threads (different requests)
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
CEHJCommented:
I think we need more info - what process, what files, etc.
0
 
Gangadhara MelukoteAuthor Commented:
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
0
 
CEHJCommented:
I would imagine it's pretty normal that a package manager (for all sorts of reasons) would not support concurrent use
0
 
for_yanCommented:
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 ?
0
 
Gangadhara MelukoteAuthor Commented:
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
0
 
CEHJCommented:
>>
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
0
 
for_yanCommented:
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 ?
0
 
Gangadhara MelukoteAuthor Commented:
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
0
 
for_yanCommented:
if you run these processs outside any java  - do you obsereve the same thing ?
0
 
Gangadhara MelukoteAuthor Commented:
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
0
 
CEHJCommented:
>>yes we tried there is no problem from outside java

How did you try it- what did you do?
0
 
Gangadhara MelukoteAuthor Commented:
I Just ran the shell script, i think that is your question am i correct?
0
 
for_yanConnect With a Mentor Commented:
no from outsisde model the same sityuation - start two of them and see iif you can start the third one
0
 
CEHJCommented:
:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.