Skip to content

fix: classify PostgreSQL lock timeouts as transient - #714

Closed
sjchmiela wants to merge 1 commit into
mainfrom
stanley/postgres-lock-timeout-transient
Closed

sjchmiela wants to merge 1 commit into
mainfrom
stanley/postgres-lock-timeout-transient

Conversation

@sjchmiela

@sjchmiela sjchmiela commented Oct 5, 2026 •

Copy link
Copy Markdown

Why

"Lock not available" is a rather transient error. Let's classify it as one!

How

Added mapping for 55P03 error code (docs link is to bytebase.com, but, well, trust me that it is the right mapping).

Test Plan

Added simple test.

@codecov

codecov Bot commented Oct 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (17bd06e) to head (9c692af).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main      #714    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files          109       109            
  Lines        18485     18487     +2     
  Branches      1596       969   -627     
==========================================
+ Hits         18485     18487     +2     
Flag Coverage Δ
integration 30.06% <50.00%> (+<0.01%) ⬆️
unittest 94.94% <100.00%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wschurman wschurman 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.

Sorry for the thrash, rebased this into new PR (#716) on top of #715 which I created after review of this.

@sjchmiela sjchmiela closed this Oct 5, 2026
wschurman added a commit that referenced this pull request Oct 5, 2026
…e-adapter-knex (#715)

# Why

While reviewing #714, noticed that it was probably better if these knex/postgres-specific errors live in their package rather than the root package.

This is a breaking change but one that is detectable via tsc so within the scope of what's allowed via minor version bump.

# How

Have claude move them. Prompt: 

> move knex-specific entity errors into the entity-database-adapter-knex package. no need for backwards
  compatibility

# Test Plan

CI
wschurman added a commit that referenced this pull request Oct 5, 2026
# Why

Re-implementation of #714 on top of #715.

# How

Prompt:

> add new error for pg code 55P03, use PR 714 as reference but a new error class

# Test Plan

CI
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.

2 participants