Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update expensify_prod branch #1746

Merged
merged 2 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions BedrockServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,6 @@ bool BedrockServer::_isControlCommand(const unique_ptr<BedrockCommand>& command)
SIEquals(command->request.methodLine, "UnblockWrites") ||
SIEquals(command->request.methodLine, "SetMaxPeerFallBehind") ||
SIEquals(command->request.methodLine, "SetMaxSocketThreads") ||
SIEquals(command->request.methodLine, "SetMaxDBHandles") ||
SIEquals(command->request.methodLine, "CRASH_COMMAND")
) {
return true;
Expand Down Expand Up @@ -1878,20 +1877,6 @@ void BedrockServer::_control(unique_ptr<BedrockCommand>& command) {
} else {
response.methodLine = "401 Don't Use Zero";
}
} else if (SIEquals(command->request.methodLine, "SetMaxDBHandles")) {
shared_ptr<SQLitePool> dbPoolHandle = _dbPool;
if (dbPoolHandle) {
size_t newMax = command->request.calcU64("handlesCount");
if (newMax) {
SINFO("Setting _dbPoolSize to " << newMax << " from " << _dbPoolSize);
} else {
response.methodLine = "401 Don't Use Zero";
}
_dbPoolSize = newMax;
dbPoolHandle->setMaxDBs(_dbPoolSize);
} else {
response.methodLine = "404 No DB Pool";
}
} else if (SIEquals(command->request.methodLine, "SetMaxPeerFallBehind")) {
// Look up the existing value so we can report what it was.
uint64_t existingValue = SQLiteNode::MAX_PEER_FALL_BEHIND;
Expand Down
6 changes: 0 additions & 6 deletions sqlitecluster/SQLitePool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ SQLite& SQLitePool::getBase() {
return _baseDB;
}

void SQLitePool::setMaxDBs(size_t newMax) {
unique_lock<mutex> lock(_sync);
SINFO("Resetting max DB filehandles to " << newMax << " from " << _maxDBs);
_maxDBs = newMax;
}

size_t SQLitePool::getIndex(bool createHandle) {
while (true) {
unique_lock<mutex> lock(_sync);
Expand Down
2 changes: 0 additions & 2 deletions sqlitecluster/SQLitePool.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ class SQLitePool {
// Takes an allocated index and creates the appropriate DB handle if required.
SQLite& initializeIndex(size_t index);

void setMaxDBs(size_t newMax);

// Return an object to the pool.
void returnToPool(size_t index);

Expand Down