in src/afs.cc [3152:3209]
void process_set_parameters_requests()
{
#ifdef AFS_VERBOSE
const char* tag = "set parameters";
#endif
std::lock_guard<std::mutex> lock(mutex_);
for (auto it = setParametersRequests_.begin();
it != setParametersRequests_.end();)
{
auto& request = *it;
auto session = static_cast<SharedSessionData*>(
dshash_find(sessions_, &(request->localSession->id), false));
if (!session)
{
request->finished = true;
request->localSession->errorMessage =
std::string("stolen session: ") +
std::to_string(request->localSession->id);
it = setParametersRequests_.erase(it);
continue;
}
if (request->processing)
{
SharedSessionReleaser sessionReleaser(sessions_, session);
if (DsaPointerIsValid(session->errorMessage))
{
request->processing = false;
request->finished = true;
it = setParametersRequests_.erase(it);
}
else if (session->setParametersFinished)
{
request->processing = false;
request->finished = true;
it = setParametersRequests_.erase(it);
}
else
{
++it;
}
}
else
{
auto executorPID = session->executorPID;
{
SharedSessionReleaser sessionReleaser(sessions_, session);
ProcessorLockGuard lock(this);
set_shared_string(session->preparedStatementHandle, request->handle);
session->action = Action::SetParameters;
session->setParametersFinished = false;
}
P("%s: %s: %s: kill executor: %d", Tag, tag_, tag, executorPID);
kill(executorPID, SIGUSR1);
request->processing = true;
++it;
}
}
}