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

fix: use an independent sql connection for mempool stats #2217

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

rafaelcr
Copy link
Collaborator

@rafaelcr rafaelcr commented Feb 5, 2025

Previously, this debounced mempool stats calculator query was sharing a single sql connection with the pg writer. If the debounced trigger coincided with a new block ingestion, both tasks reused the same SQL transaction resulting in a race condition: as soon as the block ingestion ended, the mempool stats query was cut short because the transaction was committed. This resulted in a CONNECTION_DESTROYED postgres error as described here: stacks-network/stacks-core#5663

This PR moves the mempool stats query to its own SQL connection

Copy link

github-actions bot commented Feb 5, 2025

Vercel deployment URL: https://stacks-blockchain-6vfvfmmoj-hirosystems.vercel.app 🚀

Copy link

codecov bot commented Feb 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

Copy link
Member

@zone117x zone117x left a comment

Choose a reason for hiding this comment

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

Hopefully this finally fixes the issues around this!

@rafaelcr rafaelcr merged commit f8137e4 into beta Feb 6, 2025
28 checks passed
@rafaelcr rafaelcr deleted the fix/mempool-debounce branch February 6, 2025 03:59
blockstack-devops pushed a commit that referenced this pull request Feb 6, 2025
## [8.6.0-beta.2](v8.6.0-beta.1...v8.6.0-beta.2) (2025-02-06)

### Bug Fixes

* use an independent sql connection for mempool stats ([#2217](#2217)) ([f8137e4](f8137e4))
@blockstack-devops
Copy link

🎉 This PR is included in version 8.6.0-beta.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

blockstack-devops pushed a commit that referenced this pull request Feb 6, 2025
## [8.6.0](v8.5.0...v8.6.0) (2025-02-06)

### Features

* consider tenure block fullness for transaction fee estimations ([#2203](#2203)) ([396e2ea](396e2ea))
* store total transaction size in blocks table ([#2204](#2204)) ([ac7c41b](ac7c41b))

### Bug Fixes

* make tx_total_size column nullable ([#2207](#2207)) ([77bd2f8](77bd2f8))
* use an independent sql connection for mempool stats ([#2217](#2217)) ([f8137e4](f8137e4))
@blockstack-devops
Copy link

🎉 This PR is included in version 8.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@wileyj
Copy link
Contributor

wileyj commented Feb 6, 2025

confirmed i was able to reach chain tip using this branch, thanks!

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

Successfully merging this pull request may close these issues.

4 participants