Solved

Problem with cocurrent runtime.getRuntime.exec processes

Posted on 2011-09-09
17
235 Views
Last Modified: 2012-05-12
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
0
Comment
Question by:Gangadhara Melukote
  • 7
  • 6
  • 4
17 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 36509460
Same thread or separate threads?
0
 

Author Comment

by:Gangadhara Melukote
ID: 36509562
In Different request threads (different requests)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 36509571
I think we need more info - what process, what files, etc.
0
 

Author Comment

by:Gangadhara Melukote
ID: 36509721
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 36509968
I would imagine it's pretty normal that a package manager (for all sorts of reasons) would not support concurrent use
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36510119
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
 

Author Comment

by:Gangadhara Melukote
ID: 36510792
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 36510823
>>
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 47

Expert Comment

by:for_yan
ID: 36510829
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
 

Author Comment

by:Gangadhara Melukote
ID: 36510864
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
 
LVL 47

Expert Comment

by:for_yan
ID: 36510871
if you run these processs outside any java  - do you obsereve the same thing ?
0
 

Author Comment

by:Gangadhara Melukote
ID: 36510944
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 36510985
>>yes we tried there is no problem from outside java

How did you try it- what did you do?
0
 

Author Comment

by:Gangadhara Melukote
ID: 36511003
I Just ran the shell script, i think that is your question am i correct?
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 300 total points
ID: 36511250
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
 
LVL 47

Assisted Solution

by:for_yan
for_yan earned 200 total points
ID: 36511948
no from outsisde model the same sityuation - start two of them and see iif you can start the third one
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 37137257
:)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
splitOdd10 challenge 5 74
What is JNDI datasource in spring 1 50
maven example error 3 51
MySqlDump not dumping triggers 1 12
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to implement Singleton Design Pattern in Java.

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now