Skip to content

Conversation

@danieldoglas
Copy link
Contributor

@danieldoglas danieldoglas commented Feb 9, 2026

Summary

  • _totalTransactionElapsed was only storing the last transaction's time when a command ran multiple transactions (e.g., when peek makes httpsRequests and the transaction is closed and reopened). This meant the slowest transaction could be silently lost in timing logs.
  • Changed rollback and commit to use max() so the highest transaction time is preserved across all transactions within a single command.
  • Added resetMaxTransactionElapsed() and call it at db assignment boundaries (pool handle initialization and sync thread command loop) so stale timing doesn't carry over between commands on the same db handle.

🤖 Generated with Claude Code

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8318582639

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines 143 to 146
SDEBUG("Peeking at '" << request.methodLine << "' with priority: " << command->priority);
command->peekCount++;
_db.resetMaxTransactionElapsed();
_db.setTimeout(_getRemainingTime(command, false));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reset max timing for commands that skip peek

This reset is only performed when peekCommand runs. However, BedrockServer can skip peek for commands with existing HTTPS requests (see if (command->repeek || !command->httpsRequests.size())), and those commands go straight to processCommand. With the new max() behavior in commit/rollback, _totalTransactionElapsed can now carry over from a previous command when peek is skipped, so timing logs report an inflated max unrelated to the current command. To avoid cross-command contamination, the reset needs to run at the start of any command path (e.g., before processing when peek is skipped), not just in peek.

Useful? React with 👍 / 👎.

When a command runs multiple transactions (e.g., peek then process),
_totalTransactionElapsed was only storing the last transaction's time.
This meant slow transactions in earlier phases were silently lost in
timing logs.

Use max() in both rollback and commit so the highest transaction time
is preserved. Reset the counter at command boundaries (start of
peekCommand) so it doesn't carry over between commands on the same
shared db handle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@danieldoglas danieldoglas force-pushed the dsilva-track-max-transaction-elapsed-v2 branch from 8318582 to 4e07f33 Compare February 9, 2026 20:52
danieldoglas and others added 2 commits February 9, 2026 19:58
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…Transaction

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@danieldoglas
Copy link
Contributor Author

NVM this, I forgot that we log the line every time we call rollback, so we are keepting track of all transactions, not only the last one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant