Merge pull request #6868 from nextcloud/bugfix/avoidDeadlockWithImplicitHydrationSelfRequests

avoid deadlock: cancel hydration requests coming from itself
This commit is contained in:
Matthieu Gallien 2024-07-01 16:15:25 +02:00 committed by GitHub
commit 1af5872314
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -157,6 +157,12 @@ void CALLBACK cfApiFetchDataCallback(const CF_CALLBACK_INFO *callbackInfo, const
callbackInfo->FileSize.QuadPart); callbackInfo->FileSize.QuadPart);
}; };
if (QCoreApplication::applicationPid() == callbackInfo->ProcessInfo->ProcessId) {
qCCritical(lcCfApiWrapper) << "implicit hydration triggered by the client itself. Will lead to a deadlock. Cancel";
sendTransferError();
return;
}
auto vfs = reinterpret_cast<OCC::VfsCfApi *>(callbackInfo->CallbackContext); auto vfs = reinterpret_cast<OCC::VfsCfApi *>(callbackInfo->CallbackContext);
Q_ASSERT(vfs->metaObject()->className() == QByteArrayLiteral("OCC::VfsCfApi")); Q_ASSERT(vfs->metaObject()->className() == QByteArrayLiteral("OCC::VfsCfApi"));
const auto path = QString(QString::fromWCharArray(callbackInfo->VolumeDosName) + QString::fromWCharArray(callbackInfo->NormalizedPath)); const auto path = QString(QString::fromWCharArray(callbackInfo->VolumeDosName) + QString::fromWCharArray(callbackInfo->NormalizedPath));