diff --git a/BedrockCommand.h b/BedrockCommand.h index d385de33d..1b551364f 100644 --- a/BedrockCommand.h +++ b/BedrockCommand.h @@ -140,10 +140,6 @@ class BedrockCommand : public SQLiteCommand { // A list of timing sets, with an info type, start, and end. list> 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); diff --git a/BedrockServer.cpp b/BedrockServer.cpp index 8f721e7e5..b79297266 100644 --- a/BedrockServer.cpp +++ b/BedrockServer.cpp @@ -983,10 +983,7 @@ void BedrockServer::runCommand(unique_ptr&& _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; diff --git a/sqlitecluster/SQLiteNode.cpp b/sqlitecluster/SQLiteNode.cpp index 85bac7b23..a2d1f783a 100644 --- a/sqlitecluster/SQLiteNode.cpp +++ b/sqlitecluster/SQLiteNode.cpp @@ -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); }