A couple fixes to try and track down a seg fault when a distpatch finishes.

This commit is contained in:
Ken Moore
2016-03-03 10:53:27 -05:00
parent 283f660b25
commit 21fbf8643a
2 changed files with 10 additions and 4 deletions

View File

@@ -156,14 +156,15 @@ void Dispatcher::mkProcs(Dispatcher::PROC_QUEUE queue, DProcess *P){
void Dispatcher::ProcFinished(QString ID){
//Find the process with this ID and close it down (with proper events)
//qDebug() << " - Got Proc Finished Signal:" << ID;
bool found = false;
qDebug() << " - Got Proc Finished Signal:" << ID;
/*bool found = false;
for(int i=0; i<enum_length && !found; i++){
Dispatcher::PROC_QUEUE queue = static_cast<Dispatcher::PROC_QUEUE>(i);
if(HASH.contains(queue)){
QList<DProcess*> list = HASH[queue];
for(int l=0; l<list.length() && !found; l++){
if(list[l]->ID==ID){
qDebug() << "Delete Proc on Finished:" << list[l]->ID;
QJsonObject obj;
obj.insert("log",list[l]->getProcLog());
obj.insert("success", list[l]->success ? "true" : "false" );
@@ -175,15 +176,17 @@ void Dispatcher::ProcFinished(QString ID){
list.takeAt(l)->deleteLater();
LogManager::log(LogManager::DISPATCH, obj);
found = true;
l--;
}
} //end loop over queue list
}
}//end loop over queue enumeration
}//end loop over queue enumeration*/
QTimer::singleShot(20,this, SLOT(CheckQueues()) );
}
void Dispatcher::CheckQueues(){
for(int i=0; i<enum_length; i++){
qDebug() << " - Check Queues";
for(int i=0; i<enum_length; i++){
PROC_QUEUE queue = static_cast<PROC_QUEUE>(i);
if(HASH.contains(queue)){
QList<DProcess*> list = HASH[queue];
@@ -191,6 +194,7 @@ for(int i=0; i<enum_length; i++){
if(j>0 && queue!=NO_QUEUE){ break; } //done with this - only first item in these queues should run at a time
if( !list[j]->isRunning() ){
if(list[j]->isDone() ){
qDebug() << "Delete Proc:" << list[j]->ID;
QJsonObject obj;
obj.insert("log",list[j]->getProcLog());
obj.insert("success", list[j]->success ? "true" : "false" );

View File

@@ -580,6 +580,7 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmIohyveRequest(const QJsonVal
bool ok = false;
if(keys.contains("action")){
QString act = JsonValueToString(in_args.toObject().value("action"));
//qDebug() << " - iohyve action:" << act;
if(act=="create"){
ok = true;
out->insert("create", sysadm::Iohyve::createGuest(in_args.toObject()));
@@ -627,6 +628,7 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmIohyveRequest(const QJsonVal
ok = true;
out->insert("stop", sysadm::Iohyve::stopGuest(in_args.toObject()));
}
//qDebug() << " - iohyve action finished:" << act << ok;
} //end of "action" key usage
//If nothing done - return the proper code