From d8697a47c7b11a165f3141a0b62fc8d606ae6d19 Mon Sep 17 00:00:00 2001 From: cyjseagull Date: Mon, 25 Nov 2024 16:08:30 +0800 Subject: [PATCH] fix cm2020 check hostResource --- .../ppc-psi/src/cm2020-psi/CM2020PSIImpl.cpp | 7 +++---- .../ppc-psi/src/ecdh-multi-psi/EcdhMultiPSIImpl.cpp | 2 +- .../ppc-psi/src/labeled-psi/LabeledPSIImpl.cpp | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/cpp/wedpr-computing/ppc-psi/src/cm2020-psi/CM2020PSIImpl.cpp b/cpp/wedpr-computing/ppc-psi/src/cm2020-psi/CM2020PSIImpl.cpp index 53d8f08e..ddb98811 100644 --- a/cpp/wedpr-computing/ppc-psi/src/cm2020-psi/CM2020PSIImpl.cpp +++ b/cpp/wedpr-computing/ppc-psi/src/cm2020-psi/CM2020PSIImpl.cpp @@ -155,12 +155,11 @@ void CM2020PSIImpl::asyncRunTask() psi->noticePeerToFinish(task); }); - // check the memory - checkHostResource(m_config->minNeededMemoryGB()); - addPendingTask(taskState); - try { + addPendingTask(taskState); + // check the memory + checkHostResource(m_config->minNeededMemoryGB()); // prepare reader and writer auto dataResource = task->selfParty()->dataResource(); auto reader = loadReader(task->id(), dataResource, DataSchema::Bytes); diff --git a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiPSIImpl.cpp b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiPSIImpl.cpp index 94d7ec08..3a054e9f 100644 --- a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiPSIImpl.cpp +++ b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiPSIImpl.cpp @@ -131,9 +131,9 @@ void EcdhMultiPSIImpl::asyncRunTask( psi->removePartner(taskID); psi->removePendingTask(taskID); }); + addPendingTask(taskState); // check the memory checkHostResource(m_config->minNeededMemoryGB()); - addPendingTask(taskState); // over the peer limit if (_task->getAllPeerParties().size() > c_max_peer_size) { diff --git a/cpp/wedpr-computing/ppc-psi/src/labeled-psi/LabeledPSIImpl.cpp b/cpp/wedpr-computing/ppc-psi/src/labeled-psi/LabeledPSIImpl.cpp index e56ead44..9de65a7f 100644 --- a/cpp/wedpr-computing/ppc-psi/src/labeled-psi/LabeledPSIImpl.cpp +++ b/cpp/wedpr-computing/ppc-psi/src/labeled-psi/LabeledPSIImpl.cpp @@ -115,9 +115,9 @@ void LabeledPSIImpl::asyncRunTask( psi->noticePeerToFinish(_task); }); + addPendingTask(taskState); // check the memory checkHostResource(m_config->minNeededMemoryGB()); - addPendingTask(taskState); auto oprfClient = std::make_shared( sizeof(apsi::Item::value_type) + sizeof(apsi::LabelKey), m_config->hash(),