Skip to content

Use short-lived detection execution transactions - #24

Merged
fengting124 merged 6 commits into
mainfrom
feature/short-lived-execution-transactions
Jul 10, 2026
Merged

Use short-lived detection execution transactions#24
fengting124 merged 6 commits into
mainfrom
feature/short-lived-execution-transactions

Conversation

@fengting124

Copy link
Copy Markdown
Owner

What

  • split detection claim, external inference, and result persistence into short transaction boundaries
  • add execution leases and fencing tokens so stale attempts cannot overwrite newer work
  • keep multi-model results atomic and leave busy Redis messages pending for safe redelivery
  • document transaction, recovery, and operational semantics

Why

The previous implementation held a database transaction for the entire model HTTP call. Slow inference consumed a database connection and a crashed worker had no durable execution ownership. This change makes model latency independent of database transaction duration while preserving recoverability.

Guarantees

  • only the current execution token may persist success or failure
  • expired attempts can be replaced; late responses are discarded
  • no partial predictions are stored when one model in an ensemble fails
  • model weights and GPU runtime remain outside this change

Verification

  • Java: 97 tests passed
  • frontend: 8 tests, lint, and production build passed
  • model service: 6 tests passed without weights
  • smoke tools: 3 tests passed
  • integration test asserts model inference runs without an active Spring transaction

@fengting124
fengting124 merged commit 61b223a into main Jul 10, 2026
4 checks passed
@fengting124
fengting124 deleted the feature/short-lived-execution-transactions branch July 10, 2026 23:43
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