in src/afs.cc [568:603]
void open()
{
// pg_usleep(5000000);
// pg_usleep(5000000);
pgstat_report_activity(STATE_RUNNING, (std::string(Tag) + ": opening").c_str());
session_ = static_cast<SessionData*>(dshash_find(sessions_, &sessionID_, false));
auto databaseName =
static_cast<const char*>(dsa_get_address(area_, session_->databaseName));
auto userName =
static_cast<const char*>(dsa_get_address(area_, session_->userName));
auto password =
static_cast<const char*>(dsa_get_address(area_, session_->password));
auto clientAddress =
static_cast<const char*>(dsa_get_address(area_, session_->clientAddress));
BackgroundWorkerInitializeConnection(databaseName, userName, 0);
CurrentResourceOwner = ResourceOwnerCreate(nullptr, "arrow-flight-sql: Executor");
if (!check_password(databaseName, userName, password, clientAddress))
{
session_->initialized = true;
P("%s: %s: %s: kill server: %d", Tag, tag_, AFS_FUNC, sharedData_->serverPID);
kill(sharedData_->serverPID, SIGUSR1);
return;
}
{
SharedRingBuffer buffer(&(session_->bufferData), area_);
// TODO: Customizable.
buffer.allocate(1L * 1024L * 1024L);
}
StartTransactionCommand();
SPI_connect();
pgstat_report_activity(STATE_IDLE, NULL);
session_->initialized = true;
connected_ = true;
P("%s: %s: %s: kill server: %d", Tag, tag_, AFS_FUNC, sharedData_->serverPID);
kill(sharedData_->serverPID, SIGUSR1);
}