Skip to content

[RelayMiner] Add timeout support and improved logging to query clients#1657

Merged
red-0ne merged 6 commits intomainfrom
feat/timeout-requests
Jul 11, 2025
Merged

[RelayMiner] Add timeout support and improved logging to query clients#1657
red-0ne merged 6 commits intomainfrom
feat/timeout-requests

Conversation

@red-0ne
Copy link
Copy Markdown
Contributor

@red-0ne red-0ne commented Jul 10, 2025

Summary

Add timeout support and improved logging to query clients to prevent hanging queries and improve debugging

Primary Changes:

  • Add defaultQueryTimeout constant (1 second) to all query clients
  • Wrap all query calls with timeout context using context.WithTimeout
  • Update retry.Call signature to accept logger parameter for better observability
  • Add retry logging with emojis for better debugging (🔄 for retries, 🛑 for failures)

Secondary changes:

  • Update all query client implementations to use timeout contexts
  • Update retry tests to pass logger parameter

Issue:

Performance improvement to prevent hanging queries and improve debugging capabilities

Type of change

Select one or more from the following:

  • New feature, functionality or library
  • Bug fix
  • Code health or cleanup
  • Documentation
  • Other (specify)

Sanity Checklist

  • I have updated the GitHub Issue Metadata: assignees, reviewers, labels, project, iteration and milestone
  • For docs: make docusaurus_start
  • For small changes: make go_develop_and_test and make test_e2e
  • For major changes: devnet-test-e2e label to run E2E tests in CI
  • For migration changes: make test_e2e_oneshot
  • 'TODO's, configurations and other docs

🤖 Generated with Claude Code

### Primary Changes:
- Add `defaultQueryTimeout` constant (1 second) to all query clients
- Wrap all query calls with timeout context using `context.WithTimeout`
- Update `retry.Call` signature to accept logger parameter for better observability
- Add retry logging with emojis for better debugging (🔄 for retries, 🛑 for failures)

### Secondary changes:
- Update all query client implementations to use timeout contexts
- Update retry tests to pass logger parameter

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@red-0ne red-0ne self-assigned this Jul 10, 2025
@red-0ne red-0ne added relayminer Changes related to the Relayminer off-chain Off-chain business logic labels Jul 10, 2025
@red-0ne red-0ne added this to Shannon Jul 10, 2025
@github-project-automation github-project-automation Bot moved this to 📋 Backlog in Shannon Jul 10, 2025
@red-0ne red-0ne moved this from 📋 Backlog to 🏗 In progress in Shannon Jul 10, 2025
@red-0ne red-0ne moved this from 🏗 In progress to 👀 In review in Shannon Jul 10, 2025
@red-0ne red-0ne changed the title feat: Add timeout support and improved logging to query clients [RelayMiner] Add timeout support and improved logging to query clients Jul 10, 2025
Comment thread pkg/client/query/accquerier.go Outdated
Comment thread pkg/client/query/accquerier.go Outdated
Comment thread pkg/retry/retry.go Outdated
@github-actions
Copy link
Copy Markdown

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 make trigger_ci to submit an empty commit that'll trigger the tests.

GCP workloads (requires changing the namespace to 1657)
Grafana network dashboard for devnet-issue-1657

@github-actions github-actions Bot added devnet push-image CI related - pushes images to ghcr.io labels Jul 11, 2025
@red-0ne red-0ne requested a review from Olshansk July 11, 2025 00:08
@red-0ne red-0ne merged commit 5d795af into main Jul 11, 2025
11 checks passed
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in Shannon Jul 11, 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/chore/ibc:
  fix: TODOs
  fix: onchain upgrade
  [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)
  First review
bryanchriswhite added a commit that referenced this pull request Jul 16, 2025
* chore/localnet/tilt: (88 commits)
  [Disk Utilization] refactor: remove unnecessary Msg.*Response fields (#1670)
  [RelayMiner] Bump SMT version (#1675)
  [IBC] Prepare pocket for IBC connectivity (#1262)
  fix: TODOs
  fix: onchain upgrade
  [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)
  fixup! upgrade
  fixup! upgrade
  revertme: testing
  fixup! upgrade
  Refactor Tiltfile structure and enhance Pocketdex support. (#1640)
  [Morse Recovery] Updated Recovery Allowlist (#1651)
  ...
bryanchriswhite added a commit that referenced this pull request Jul 16, 2025
* chore/ibc-axelar: (92 commits)
  [Disk Utilization] refactor: remove unnecessary Msg.*Response fields (#1670)
  [RelayMiner] Bump SMT version (#1675)
  [IBC] Prepare pocket for IBC connectivity (#1262)
  fix: TODOs
  fix: onchain upgrade
  [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)
  fixup! upgrade
  fixup! upgrade
  revertme: testing
  fixup! upgrade
  Refactor Tiltfile structure and enhance Pocketdex support. (#1640)
  [Morse Recovery] Updated Recovery Allowlist (#1651)
  ...
bryanchriswhite added a commit that referenced this pull request Jul 16, 2025
* chore/ibc-axelar: (88 commits)
  [Disk Utilization] refactor: remove unnecessary Msg.*Response fields (#1670)
  [RelayMiner] Bump SMT version (#1675)
  [IBC] Prepare pocket for IBC connectivity (#1262)
  fix: TODOs
  fix: onchain upgrade
  [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)
  fixup! upgrade
  fixup! upgrade
  revertme: testing
  fixup! upgrade
  Refactor Tiltfile structure and enhance Pocketdex support. (#1640)
  [Morse Recovery] Updated Recovery Allowlist (#1651)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devnet devnet-test-e2e off-chain Off-chain business logic push-image CI related - pushes images to ghcr.io relayminer Changes related to the Relayminer

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants