Repository navigation
Release: https://crates.io/crates/duroxide/0.2.0
Added
- Opt-in activity resource admission through
ActivityAdmission, the default
ActivityHandler::try_admitmethod, and theregister_with_admissionand
register_typed_with_admissionregistration helpers.
Admission can retain a guard for the handler's lifetime or durably defer
execution without occupying a worker slot or recording an activity result.
Positive retry delays are clamped to 1 ms–24 hours. Only committed deferrals
restore their fetch attempt; failed or interrupted deferrals may still use
the poison-message budget, even when the handler never starts. Uncommitted
deferral delays may be lost on lock expiry. Successfully observed deferrals
have a separateduroxide_activity_admission_deferrals_totalmetric and the
MetricsProvider::activity_admission_deferrals()accessor for in-process
counts without changing the publicMetricsSnapshotshape. (#74) - Admission errors, callback panics, and zero retry delays produce terminal
ActivityFailedapplication results withretryable: false, without invoking
the handler. Orchestration-level retry helpers still retry these errors
according to their policy. (#74)
Fixed
-
SQLite worker selection now orders eligible items by visibility time, then
queue ID, so a deferred backlog cannot repeatedly overtake already-ready work.
Migration20240113000000adds the supportingvisible_at, idindex to new
and existing file-backed databases.
Other providers must implement equivalent queue progress semantics; existing
stored histories and work-item formats are unchanged. SQLite workers must all
be upgraded to provide this behavior in a mixed-version deployment. (#74) -
Activity metadata uses the lightweight instance lookup for the current
execution instead of re-reading its full history on every attempt. Activities
from earlier executions read their own execution's metadata. Both lookup paths
record provider-operation metrics. If the execution-history fallback fails,
processing now abandons the fetch with its attempt counted and reports an
infrastructure error instead of invoking the activity withunknownmetadata.
This applies to ordinary and admission-controlled activities; repeated read
failures can exhaust the fetch budget before either handler runs. Metadata
failures are logged separately from acknowledgment and deferral failures. (#74) -
Failed deferral retries preserve the requested delay and attempt-restoration
flag. (#74) -
Relative SQLite queue delays saturate instead of overflowing their timestamp
representation. (#74) -
Provider validation's multi-threaded lock-expiration recovery test measures
its waits from the first completed claim, so connection warm-up cannot consume
the expiry margin. The lease duration and margin are unchanged. (#76) -
Orchestration poison reporting - Count
duroxide_orchestration_poison_total
only when the provider confirms the acknowledgement. Errors after retry handling
increment the newduroxide_orchestration_poison_failed_totalcounter and emit a
correlated error log without claiming the write did not commit. This applies to
exceeded-attempt and corrupted-history handling as well as poison propagated from
activities or child orchestrations. The new count is also exposed through
MetricsProvider::orchestration_poison_failed()without changingMetricsSnapshot.
Retry, lease, and activity poison accounting behavior are unchanged. (#73) -
Activity acknowledgement retries - Retry transient provider errors when
acknowledging activity success or application errors, up to five attempts with
lock renewal retained. This avoids unnecessary activity re-execution.
Cancellation acknowledgements remain single-attempt, and retries do not extend
the shutdown grace period. A permanent error after a transient acknowledgement
error is reported as an uncertain outcome rather than a confirmed infrastructure
failure; neither commit nor redelivery is guaranteed. Uncertain outcomes are
counted separately induroxide_activity_ack_uncertain_total. (#72)
Provider notes for 0.2.0
- Duplicate activity acknowledgements - Completion acknowledgements can be
retried after the transaction committed but its response was lost. Providers
must atomically remove the locked worker item and enqueue its completion.
After that commit, repeatingack_work_item(token, Some(completion))with the
same token must return a non-retryable error without enqueueing another
completion. See the provider contract. (#72) - After upgrading the Duroxide dependency, register
duroxide::provider_validations::test_ack_work_item_duplicate_rejected
in your provider's validation suite. It acknowledges the same token twice and
verifies that the second call fails non-retryably, exactly one completion is
queued, and the worker item is removed. SQLite already runs this validation;
external providers must add their own wrapper. (#72) - To check queue ordering, run
test_worker_deferred_item_does_not_starve_ready_work
against your provider. It verifies that an expired deferral yields to ready
work for both session and non-session fetches. (#74)