Skip to content

fix(udb): add txn tagging#4328

Open
MasterPtato wants to merge 1 commit into02-27-fix_api_make_actor_destroy_wait_for_ackfrom
02-27-fix_udb_add_txn_tagging
Open

fix(udb): add txn tagging#4328
MasterPtato wants to merge 1 commit into02-27-fix_api_make_actor_destroy_wait_for_ackfrom
02-27-fix_udb_add_txn_tagging

Conversation

@MasterPtato
Copy link
Contributor

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@railway-app
Copy link

railway-app bot commented Feb 27, 2026

🚅 Deployed to the rivet-pr-4328 environment in rivet-frontend

Service Status Web Updated (UTC)
website 😴 Sleeping (View Logs) Web Feb 27, 2026 at 11:58 pm
frontend-cloud 😴 Sleeping (View Logs) Web Feb 27, 2026 at 11:57 pm
frontend-inspector 😴 Sleeping (View Logs) Web Feb 27, 2026 at 11:55 pm
ladle ❌ Build Failed (View Logs) Web Feb 27, 2026 at 11:49 pm
mcp-hub ✅ Success (View Logs) Web Feb 27, 2026 at 11:48 pm

@MasterPtato MasterPtato mentioned this pull request Feb 27, 2026
11 tasks
Copy link
Contributor Author

MasterPtato commented Feb 27, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@claude
Copy link

claude bot commented Feb 27, 2026

Review: fix(udb): add txn tagging

This is a small, focused PR that adds a tag method to TransactionDriver and Transaction. Here's my feedback:

Observations

No driver implementations

Neither PostgresTransactionDriver nor RocksDbTransactionDriver override the tag method, so calling txn.tag("my-tag") silently does nothing in both supported backends. Given the existing metrics infrastructure (TRANSACTION_TOTAL, TRANSACTION_PENDING, TRANSACTION_DURATION all use a name label), it would be worth clarifying whether this is a follow-up stub (with implementations coming in a subsequent PR) or if the intent is different.

If it's a stub, that's fine — but consider whether the silent no-op could cause confusion for callers who expect tagging to affect observability.

Relationship to Database::txn

database.rs already has a txn(name, closure) API that threads the name through to metrics. The new Transaction::tag method would complement this for transactions created via create_trx() or where the name can only be determined dynamically inside the closure. A small comment in either tag or the docstring clarifying this relationship would help future readers.

Comment style (minor)

Per the project conventions, the comment // No-op unless implemented documents an absence/delta, which the style guide cautions against unless it's unintuitive why something isn't there. Since the trait already has other methods without default implementations, the no-op default is self-evident from the trait definition. Consider removing the comment or replacing it with a sentence explaining the intent (e.g., // Default implementation for drivers that do not support transaction tagging.).

Missing docstring on the trait method

The Transaction::tag method has a doc comment but the TransactionDriver::tag trait method has none. Since this is the primary extension point, adding a brief /// explaining what a tag is used for (observability? tracing? metrics?) would help implementors.

Summary

The interface is clean and consistent with the rest of the module. The main open question is whether this is intentionally a no-op stub (to be wired up to metrics/tracing in a follow-up) or if there's a concrete use case where the default no-op is expected to be sufficient. If the former, a TODO comment pointing to the intended implementation would add clarity.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 27, 2026

More templates

@rivetkit/cloudflare-workers

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/cloudflare-workers@4328

@rivetkit/framework-base

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/framework-base@4328

@rivetkit/next-js

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/next-js@4328

@rivetkit/react

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/react@4328

rivetkit

pnpm add https://pkg.pr.new/rivet-dev/rivet/rivetkit@4328

@rivetkit/sql-loader

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sql-loader@4328

@rivetkit/sqlite-vfs

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sqlite-vfs@4328

@rivetkit/traces

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/traces@4328

@rivetkit/workflow-engine

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/workflow-engine@4328

@rivetkit/virtual-websocket

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/virtual-websocket@4328

@rivetkit/engine-runner

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner@4328

@rivetkit/engine-runner-protocol

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner-protocol@4328

commit: edf0cfc

@MasterPtato
Copy link
Contributor Author

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.

1 participant