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

Error Handling for Long-Lived Database Transactions #6699

Closed
1 task done
danielharrisgsr opened this issue Feb 20, 2024 · 1 comment
Closed
1 task done

Error Handling for Long-Lived Database Transactions #6699

danielharrisgsr opened this issue Feb 20, 2024 · 1 comment
Labels
A-db Related to the database A-observability Related to tracing, metrics, logs and other observability tools C-bug An unexpected or incorrect behavior

Comments

@danielharrisgsr
Copy link

Describe the bug

when using the DatabaseProvider, which is a wrapper around a database transaction, the underlying transaction has a time-to-live of 5 minutes before invalidating

WARN Long-lived read transactions has been aborted open_duration=300.000069522s

This can cause bad behaviour if for example the provider is being held onto (as a struct field), and a database transaction is attempted, then the following error is encountered

InitCursor(DatabaseErrorInfo { message: \"wrong signature of a runtime object(s)\", code: -30420 }

Although not necessarily a bug, this issue is a bug/feature request for improved error handling around this case, where instead the user should see some error relating to the underlying tx timeout. Rather than a cryptic memory error related to the MDBX database

Steps to reproduce

case is in custom RPC extension

  1. I implement the RethNodeCommandConfig trait, and specifically extend_rpc_modules method
let provider = components.provider().database_provider_ro()?;

gives a DatabaseProviderRO

  1. Give this provider to a struct you want to implement CustomEthNamespaceServer
  2. call some database-walking trait method inside your custom namespace method
let transactions_in_range = database_provider.transactions_by_block_range(block_range)
  1. Call your custom endpoint via RPC after 5 minutes of your node being up

Node logs

WARN Long-lived read transactions has been aborted open_duration=300.000069522s

Platform(s)

Linux (x86)

What version/commit are you on?

0.1.0-alpha.19

What database version are you on?

1

What type of node are you running?

Full via --full flag

What prune config do you use, if any?

No response

If you've built Reth from source, provide the full command you used

No response

Code of Conduct

  • I agree to follow the Code of Conduct
@danielharrisgsr danielharrisgsr added C-bug An unexpected or incorrect behavior S-needs-triage This issue needs to be labelled labels Feb 20, 2024
@shekhirin shekhirin added A-db Related to the database A-observability Related to tracing, metrics, logs and other observability tools and removed S-needs-triage This issue needs to be labelled labels Feb 21, 2024
@emhane
Copy link
Member

emhane commented Feb 26, 2024

is this maybe related to #6441?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-db Related to the database A-observability Related to tracing, metrics, logs and other observability tools C-bug An unexpected or incorrect behavior
Projects
Archived in project
Development

No branches or pull requests

3 participants