mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-6363: [Automation] jetty server is going OOM for simulator
This commit is contained in:
parent
a3bfda1350
commit
5f53dced5e
|
|
@ -25,10 +25,12 @@ import java.util.Date;
|
|||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.naming.ConfigurationException;
|
||||
|
||||
import org.apache.cloudstack.managed.context.ManagedContextRunnable;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.agent.IAgentControl;
|
||||
|
|
@ -244,7 +246,19 @@ public class AgentResourceBase implements ServerResource {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Answer executeRequest(Command cmd) {
|
||||
public final Answer executeRequest(final Command cmd) {
|
||||
final AtomicReference<Answer> result = new AtomicReference<Answer>();
|
||||
new ManagedContextRunnable() {
|
||||
@Override
|
||||
protected void runInContext() {
|
||||
result.set(executeRequestInContext(cmd));
|
||||
}
|
||||
}.run();
|
||||
|
||||
return result.get();
|
||||
}
|
||||
|
||||
public Answer executeRequestInContext(Command cmd) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ public class AgentRoutingResource extends AgentStorageResource {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Answer executeRequest(Command cmd) {
|
||||
public Answer executeRequestInContext(Command cmd) {
|
||||
try {
|
||||
if (cmd instanceof StartCommand) {
|
||||
return execute((StartCommand)cmd);
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public class AgentStorageResource extends AgentResourceBase implements Secondary
|
|||
}
|
||||
|
||||
@Override
|
||||
public Answer executeRequest(Command cmd) {
|
||||
public Answer executeRequestInContext(Command cmd) {
|
||||
if (cmd instanceof ReadyCommand) {
|
||||
return new ReadyAnswer((ReadyCommand)cmd);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue