use of es.bsc.compss.types.request.exceptions.ShutdownException in project compss by bsc-wdc.
the class AccessProcessor method run.
@Override
public void run() {
while (keepGoing) {
APRequest request = null;
try {
request = requestQueue.take();
if (Tracer.isActivated()) {
Tracer.emitEvent(Tracer.getAPRequestEvent(request.getRequestType().name()).getId(), Tracer.getRuntimeEventsType());
}
request.process(this, taskAnalyser, dataInfoProvider, taskDispatcher);
if (Tracer.isActivated()) {
Tracer.emitEvent(Tracer.EVENT_END, Tracer.getRuntimeEventsType());
}
} catch (ShutdownException se) {
if (Tracer.isActivated()) {
Tracer.emitEvent(Tracer.EVENT_END, Tracer.getRuntimeEventsType());
}
se.getSemaphore().release();
break;
} catch (Exception e) {
LOGGER.error("Exception", e);
if (Tracer.isActivated()) {
Tracer.emitEvent(Tracer.EVENT_END, Tracer.getRuntimeEventsType());
}
}
}
LOGGER.info("AccessProcessor shutdown");
}
use of es.bsc.compss.types.request.exceptions.ShutdownException in project compss by bsc-wdc.
the class TaskDispatcher method run.
// Dispatcher thread
@Override
public void run() {
while (keepGoing) {
String requestType = "Not defined";
try {
TDRequest request = requestQueue.take();
requestType = request.getType().toString();
if (Tracer.isActivated()) {
Tracer.emitEvent(Tracer.getTDRequestEvent(request.getType().name()).getId(), Tracer.getRuntimeEventsType());
}
request.process(scheduler);
if (Tracer.isActivated()) {
Tracer.emitEvent(Tracer.EVENT_END, Tracer.getRuntimeEventsType());
}
} catch (InterruptedException ie) {
if (Tracer.isActivated()) {
Tracer.emitEvent(Tracer.EVENT_END, Tracer.getRuntimeEventsType());
}
Thread.currentThread().interrupt();
continue;
} catch (ShutdownException se) {
LOGGER.debug("Exiting dispatcher because of shutting down");
if (Tracer.isActivated()) {
Tracer.emitEvent(Tracer.EVENT_END, Tracer.getRuntimeEventsType());
}
se.getSemaphore().release();
break;
} catch (Exception e) {
LOGGER.error("Error in request " + requestType, e);
if (Tracer.isActivated()) {
Tracer.emitEvent(Tracer.EVENT_END, Tracer.getRuntimeEventsType());
}
continue;
}
}
}
Aggregations