[RelayMiner] Improve SafeReadBody concurrency safety by copying buffer data#1650
Merged
[RelayMiner] Improve SafeReadBody concurrency safety by copying buffer data#1650
Conversation
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
The CI will now also run the e2e tests on devnet, which increases the time it takes to complete all CI checks. You may need to run GCP workloads (requires changing the namespace to 1650) |
jorgecuesta
approved these changes
Jul 8, 2025
Olshansk
approved these changes
Jul 8, 2025
bryanchriswhite
added a commit
that referenced
this pull request
Jul 14, 2025
* pokt/main: (34 commits) [RelayMiner] feat: relay miner routes to multiple backend URLs based on RPC Type (#1633) [Morse Recovery] Added new addresses for recovery (#1667) [DOCS][SERVICE] Adding danger for Grove employees on mainnet service creation (#1666) [Foundation] Remove `pulsar` (#1661) [RelayMiner] Add timeout support and improved logging to query clients (#1657) [RelayMiner] Replace buffer copying with explicit cleanup pattern in SafeReadBody (#1658) [Testing] Fixing flaky unit tests to make CI more reliable (#1662) [Scripts] Notes, events and queries to query `block` events and `tx` events (#1660) [Morse Recovery] Add recovery addresses for issue #1654 (#1656) Refactor Tiltfile structure and enhance Pocketdex support. (#1640) [Morse Recovery] Updated Recovery Allowlist (#1651) [RelayMiner] Improve SafeReadBody concurrency safety by copying buffer data (#1650) Add a configurable max body size parameter to RelayMiner configuration. (#1566) Update upgrade_tx_v0.1.25_alpha.json feat: Improve relay request unmarshaling error handling and logging (#1649) [Docs] v0.1.25/26 upgrage artifacts (#1648) Remove settlement result from `EventClaimSettled` in `v0.127` release. (#1647) Revert "feat: Remove settlement result from EventClaimSettled" (#1643) [Code Health] Fix linter issues & attempt to fix flaky tests (#1646) Updating config-path-x.yaml with: schema header, owned app for config-path-1 ...
bryanchriswhite
added a commit
that referenced
this pull request
Jul 16, 2025
* pokt/main: (69 commits) Refactor Tiltfile structure and enhance Pocketdex support. (#1640) [Morse Recovery] Updated Recovery Allowlist (#1651) [RelayMiner] Improve SafeReadBody concurrency safety by copying buffer data (#1650) Add a configurable max body size parameter to RelayMiner configuration. (#1566) Update upgrade_tx_v0.1.25_alpha.json feat: Improve relay request unmarshaling error handling and logging (#1649) [Docs] v0.1.25/26 upgrage artifacts (#1648) Remove settlement result from `EventClaimSettled` in `v0.127` release. (#1647) Revert "feat: Remove settlement result from EventClaimSettled" (#1643) [Code Health] Fix linter issues & attempt to fix flaky tests (#1646) Updating config-path-x.yaml with: schema header, owned app for config-path-1 [Shannon SDK] Update the `shannon-sdk` in prep for `v0.1.26` (#1641) [RelayMiner] Add chain version retrieval functionality to block client (#1639) [RelayMiner] Avoid concurrent access to shared logger (#1636) [Telegram] Add Korbit channel to broadcast workflow (#1634) upgrade: Prepare upgrade plan for v0.1.26 (#1635) [RelayMiner] Add proper timeout handling for RelayMiner HTTP requests (#1595) [Code only] fix: implement backward compatible relay response signatures (from #1629) (#1630) [Misc] Misc fixes & improvements (#1632) Added pocket-knife to ecosystem tools (#1622) ...
bryanchriswhite
added a commit
that referenced
this pull request
Jul 16, 2025
* refs/heads/chore/ibc: (69 commits) Refactor Tiltfile structure and enhance Pocketdex support. (#1640) [Morse Recovery] Updated Recovery Allowlist (#1651) [RelayMiner] Improve SafeReadBody concurrency safety by copying buffer data (#1650) Add a configurable max body size parameter to RelayMiner configuration. (#1566) Update upgrade_tx_v0.1.25_alpha.json feat: Improve relay request unmarshaling error handling and logging (#1649) [Docs] v0.1.25/26 upgrage artifacts (#1648) Remove settlement result from `EventClaimSettled` in `v0.127` release. (#1647) Revert "feat: Remove settlement result from EventClaimSettled" (#1643) [Code Health] Fix linter issues & attempt to fix flaky tests (#1646) Updating config-path-x.yaml with: schema header, owned app for config-path-1 [Shannon SDK] Update the `shannon-sdk` in prep for `v0.1.26` (#1641) [RelayMiner] Add chain version retrieval functionality to block client (#1639) [RelayMiner] Avoid concurrent access to shared logger (#1636) [Telegram] Add Korbit channel to broadcast workflow (#1634) upgrade: Prepare upgrade plan for v0.1.26 (#1635) [RelayMiner] Add proper timeout handling for RelayMiner HTTP requests (#1595) [Code only] fix: implement backward compatible relay response signatures (from #1629) (#1630) [Misc] Misc fixes & improvements (#1632) Added pocket-knife to ecosystem tools (#1622) ... # Conflicts: # Makefile # Tiltfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix concurrency safety issue in SafeReadBody by copying buffer data before returning to prevent race conditions with sync.Pool reuse.
Primary Changes:
SafeReadBodyfunction to prevent race conditionsSafeReadBodyfunctionSecondary changes:
http_utils_test.gowith various test scenarios including edge casesIssue:
Problem: The
SafeReadBodyfunction was returning buffer data directly without copying, which could lead to race conditions when the buffer is returned to the sync.Pool and reused by other goroutines.Type of change
Sanity Checklist
assignees,reviewers,labels,project,iterationandmilestonemake docusaurus_startmake go_develop_and_testandmake test_e2edevnet-test-e2elabel to run E2E tests in CImake test_e2e_oneshot🤖 Generated with Claude Code