Skip to content

Commit

Permalink
Merge pull request #1589 from Expensify/tyler-kill-onlyProcessOnSyncT…
Browse files Browse the repository at this point in the history
…hread

Remove obsolete API
  • Loading branch information
Joel Bettner authored Oct 5, 2023
2 parents ae45589 + 6a30cf3 commit a99a82f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
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

0 comments on commit a99a82f

Please sign in to comment.