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

Merged
merged 2 commits into from
Oct 2, 2023
Merged
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
14 changes: 8 additions & 6 deletions BedrockServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -814,8 +814,10 @@ void BedrockServer::runCommand(unique_ptr<BedrockCommand>&& _command, bool isBlo
while (true) {

// If there are outstanding HTTPS requests on this command (from a previous call to `peek`) we process them here.
size_t networkLoopCount = 0;
uint64_t postPollCumulativeTime = 0;
while (!command->areHttpsRequestsComplete()) {
SINFO("Running command network activity loop.");
networkLoopCount++;
fd_map fdm;
command->prePoll(fdm);
const uint64_t now = STimeNow();
Expand All @@ -833,11 +835,11 @@ void BedrockServer::runCommand(unique_ptr<BedrockCommand>&& _command, bool isBlo

auto start = STimeNow();
command->postPoll(fdm, nextActivity, maxWaitMs);
auto elapsedUS = STimeNow() - start;
if (elapsedUS > 100'000) {
// We warn here as this is a potential serious performance issue that seems to happen sometimes.
SWARN("Post poll on command '" << command->request.methodLine << "' took " << elapsedUS << "us.");
}
postPollCumulativeTime += (STimeNow() - start);
}

if (networkLoopCount) {
SINFO("Completed HTTPS request in " << networkLoopCount << " loops with " << postPollCumulativeTime << " total time in postPoll");
}

// Get a DB handle to work on. This will automatically be returned when dbScope goes out of scope.
Expand Down