Skip to content

Shrink DB connection buffer after auction insert - #5322

Merged
jmg-duarte merged 1 commit into
mainfrom
jmgd/shrink-db-conn-buffer
Nov 20, 2026
Merged

jmg-duarte merged 1 commit into
mainfrom
jmgd/shrink-db-conn-buffer

Conversation

@jmg-duarte

@jmg-duarte jmg-duarte commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Description

Addresses #5314

Calls shrink_buffers after the auction INSERT as a form of cleaning up after ourselves, avoiding increasing the memory consumption of other connections in the pool.

Changes

  • Call shrink_buffers after auction INSERT

How to test

Tested by deploying to base's production autopilot (blue & green are AFTER deployment)

image

@jmg-duarte
jmg-duarte marked this pull request as ready for review November 20, 2026 10:38
@jmg-duarte
jmg-duarte requested a review from a team as a code owner November 20, 2026 10:38
@claude

claude Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @jmg-duarte's task in 22s —— View job


Review

I found no problems that need a change.

  • Because PoolConnection derefs to PgConnection, ex.shrink_buffers() resolves through the sqlx::Connection import as intended.
  • sqlx's shrink_buffers keeps any bytes that haven't been flushed yet, so it's safe to call here.
  • The shrink runs before ?, so it also happens when the insert fails. That's correct, because the connection goes back to the pool either way.
  • If the future is cancelled mid-insert, the shrink is skipped. That should be rare enough to ignore.

@github-actions

Copy link
Copy Markdown

🤖 Claude reviewed this PR. Any issues are posted as inline comments on the relevant lines.

  • Runs automatically when a PR is opened or marked ready for review.
  • Re-run it: comment @claude on this PR (requires write access; bots and drafts are skipped).
  • Skip it: add the skip-claude-review label.

Won't run when: the PR is a draft, the author is a bot or lacks write access, or the skip-claude-review label is set.

@AryanGodara AryanGodara left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. (given CI should fix now that #5323 is merged)

@jmg-duarte
jmg-duarte enabled auto-merge November 20, 2026 11:58
Signed-off-by: José Duarte <15343819+jmg-duarte@users.noreply.github.com>
@jmg-duarte
jmg-duarte force-pushed the jmgd/shrink-db-conn-buffer branch from a8cbdde to 6033f94 Compare November 20, 2026 15:00
@jmg-duarte
jmg-duarte added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 2475639 Nov 20, 2026
24 of 25 checks passed
@jmg-duarte
jmg-duarte deleted the jmgd/shrink-db-conn-buffer branch November 20, 2026 15:08
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants