##// END OF EJS Templates
Remove regression for aborting request during processRequest method
perrinel -
r827:83da67fa98c8
parent child
Show More
@@ -102,6 +102,7 QUuid VariableAcquisitionWorker::pushVariableRequest(QUuid varRequestId, QUuid v
102 102
103 103 // remove old acqIdentifier from the worker
104 104 impl->cancelVarRequest(varRequestIdCanceled);
105 // impl->m_AcqIdentifierToAcqRequestMap.erase(oldAcqId);
105 106 }
106 107 else {
107 108 // First request for the variable, it must be stored and executed
@@ -141,7 +141,6 struct VariableController::VariableControllerPrivate {
141 141
142 142 std::map<QUuid, std::deque<QUuid> > m_VarIdToVarRequestIdQueueMap;
143 143
144
145 144 VariableController *q;
146 145 };
147 146
@@ -282,11 +281,11 VariableController::createVariable(const QString &name, const QVariantHash &meta
282 281
283 282 // Associate the provider
284 283 impl->m_VariableToProviderMap[newVariable] = provider;
285 qCInfo(LOG_VariableController()) << "createVariable: " << identifier;
286 284 impl->m_VariableToIdentifierMap[newVariable] = identifier;
287 285
288 286
289 287 auto varRequestId = QUuid::createUuid();
288 qCInfo(LOG_VariableController()) << "createVariable: " << identifier << varRequestId;
290 289 impl->processRequest(newVariable, range, varRequestId);
291 290 impl->updateVariableRequest(varRequestId);
292 291
@@ -471,7 +470,7 void VariableController::onRequestDataLoading(QVector<std::shared_ptr<Variable>
471 470 << QThread::currentThread()->objectName() << varRequestId;
472 471
473 472 for (const auto &var : variables) {
474 qCDebug(LOG_VariableController()) << "processRequest for" << var->name() << varRequestId;
473 qCInfo(LOG_VariableController()) << "processRequest for" << var->name() << varRequestId;
475 474 impl->processRequest(var, range, varRequestId);
476 475 }
477 476
@@ -508,8 +507,8 void VariableController::onRequestDataLoading(QVector<std::shared_ptr<Variable>
508 507 // Don't process already processed var
509 508 if (!variables.contains(var)) {
510 509 if (var != nullptr) {
511 qCDebug(LOG_VariableController()) << "processRequest synchro for"
512 << var->name();
510 qCInfo(LOG_VariableController()) << "processRequest synchro for"
511 << var->name() << varRequestId;
513 512 auto vSyncRangeRequested = computeSynchroRangeRequested(
514 513 var->range(), range, groupIdToOldRangeMap.at(gId));
515 514 qCDebug(LOG_VariableController()) << "synchro RR" << vSyncRangeRequested;
@@ -616,12 +615,6 void VariableController::VariableControllerPrivate::processRequest(std::shared_p
616 615 DataProviderParameters{std::move(notInCacheRangeList), var->metadata()},
617 616 varProvider);
618 617
619 if (!varRequestIdCanceled.isNull()) {
620 qCInfo(LOG_VariableAcquisitionWorker()) << tr("varRequestIdCanceled: ")
621 << varRequestIdCanceled;
622 // cancelVariableRequest(varRequestIdCanceled);
623 abortVariableRequest(varRequestIdCanceled);
624 }
625 618 }
626 619 else {
627 620 qCCritical(LOG_VariableController())
@@ -862,6 +855,9 void VariableController::VariableControllerPrivate::abortVariableRequest(QUuid v
862 855 if (varRequestIdToVarIdVarRequestMapIt != m_VarRequestIdToVarIdVarRequestMap.cend()) {
863 856 varRequestIdsMap = varRequestIdToVarIdVarRequestMapIt->second;
864 857 }
858 qCCritical(LOG_VariableController())
859 << tr("abortVariableRequest : varRequestId and count of aborting") << varRequestId
860 << varRequestIdsMap.size();
865 861
866 862 auto nextUuidToRemove = QSet<QUuid>{};
867 863 auto varIdEnd = varRequestIdsMap.end();
@@ -891,6 +887,9 void VariableController::VariableControllerPrivate::abortVariableRequest(QUuid v
891 887 }
892 888 }
893 889
890 qCCritical(LOG_VariableController()) << tr("remove the request : aborting")
891 << currentVarId;
892
894 893 varReqIdQueueIt = varRequestIdQueue.erase(varReqIdQueueIt);
895 894 // break is necessary here, we don"t need to iterate on the dequeue anymore and
896 895 // the iteration is broken because of the erase
@@ -910,10 +909,13 void VariableController::VariableControllerPrivate::abortVariableRequest(QUuid v
910 909 }
911 910
912 911 if (varRequestIdToVarIdVarRequestMapIt != m_VarRequestIdToVarIdVarRequestMap.cend()) {
912 qCCritical(LOG_VariableController()) << tr("remove the varRequestId");
913 913 m_VarRequestIdToVarIdVarRequestMap.erase(varRequestIdToVarIdVarRequestMapIt);
914 914 }
915 915
916 916 for (auto nextVarRequestIdToRm : nextUuidToRemove) {
917 qCCritical(LOG_VariableController()) << tr("Cancel automaticaly the next request:")
918 << nextVarRequestIdToRm;
917 919 abortVariableRequest(nextVarRequestIdToRm);
918 920 }
919 921 }
General Comments 3
Under Review
author

Auto status change to "Under Review"

Approved
author

Merge lasted acquisition developpement on main Sciqlop branch

You need to be logged in to leave comments. Login now