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

[Merged by Bors] - Prevent connection pool from emptying upon panics #6408

Closed
wants to merge 2 commits into from

Conversation

fasmat
Copy link
Member

@fasmat fasmat commented Oct 23, 2024

Motivation

Ensure an active statement is reset even if decoder in db.Exec panics

Description

Crawshaw panics internally when putting a connection back into the pool that was not reset. SetInterupt does this explicitly which is why #6407 also fixes this issue. This change has a smaller footprint and adds a test.

Test Plan

New test for panics in decoder

TODO

  • Explain motivation or link existing issue(s)
  • Test changes and document test plan
  • Update documentation as needed
  • Update changelog as needed

@fasmat
Copy link
Member Author

fasmat commented Oct 23, 2024

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request Oct 23, 2024
## Motivation

Ensure an active statement is reset even if `decoder` in `db.Exec` panics
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Project coverage is 79.7%. Comparing base (55c3547) to head (cafabdb).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
sql/database.go 85.7% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           develop   #6408     +/-   ##
=========================================
- Coverage     79.8%   79.7%   -0.1%     
=========================================
  Files          328     328             
  Lines        42879   42884      +5     
=========================================
- Hits         34221   34199     -22     
- Misses        6725    6753     +28     
+ Partials      1933    1932      -1     

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

@spacemesh-bors
Copy link

Pull request successfully merged into develop.

Build succeeded:

@spacemesh-bors spacemesh-bors bot changed the title Prevent connection pool from emptying upon panics [Merged by Bors] - Prevent connection pool from emptying upon panics Oct 23, 2024
@spacemesh-bors spacemesh-bors bot closed this Oct 23, 2024
@spacemesh-bors spacemesh-bors bot deleted the restet-statements-on-panic branch October 23, 2024 14:35
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