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 #1590

Merged
merged 4 commits into from
Oct 9, 2023
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
4 changes: 0 additions & 4 deletions BedrockCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,6 @@ class BedrockCommand : public SQLiteCommand {
// A list of timing sets, with an info type, start, and end.
list<tuple<TIMING_INFO, uint64_t, uint64_t>> timingInfo;

// This defaults to false, but a specific plugin can set it to 'true' to force this command to be passed
// to the sync thread for processing, thus guaranteeing that process() will not result in a conflict.
virtual bool onlyProcessOnSyncThread() { return false; }

// Add any sockets that this command has opened (not the socket the client sent it on, but any outgoing sockets
// it's opened itself) to a fd_map so that they can be polled for activity.
void prePoll(fd_map& fdm);
Expand Down
5 changes: 1 addition & 4 deletions BedrockServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -983,10 +983,7 @@ void BedrockServer::runCommand(unique_ptr<BedrockCommand>&& _command, bool isBlo
}

// Peek wasn't enough to handle this command. See if we think it should be writable in parallel.
// We check `onlyProcessOnSyncThread` here, rather than before processing the command, because it's
// not set at creation time, it's set in `peek`, so we need to wait at least until after peek is
// called to check it.
if (command->onlyProcessOnSyncThread() || !canWriteParallel) {
if (!canWriteParallel) {
// Roll back the transaction, it'll get re-run in the sync thread.
core.rollback();
auto _clusterMessengerCopy = _clusterMessenger;
Expand Down
2 changes: 1 addition & 1 deletion sqlitecluster/SQLiteNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1657,7 +1657,7 @@ void SQLiteNode::_onMESSAGE(SQLitePeer* peer, const SData& message) {
thread(&SQLiteNode::_replicate, this, peer, message, _dbPool->getIndex(false), threadAttemptStartTimestamp).detach();
} catch (const system_error& e) {
SWARN("Caught system_error starting _replicate thread with " << _replicationThreadCount.load() << " threads. e.what()=" << e.what());
throw;
STHROW("Error starting replicate thread so giving up and reconnecting.");
}
SDEBUG("Done spawning concurrent replicate thread: " << threadID);
}
Expand Down