Surface execution-history lookup failures in df.instance_executions (#168)#225
Merged
pinodeca merged 1 commit intoJun 12, 2026
Conversation
…icrosoft#168) df.instance_executions() previously swallowed every failure (runtime build, provider connect, list_executions, get_execution_info) into an empty rowset. Because a completed instance always has at least one execution row, an empty result was indistinguishable from a silently failed lookup, masking real errors (issue microsoft#168). These failures now raise an explicit error, while the genuinely-empty case (a non-existent or non-owned instance, gated by the RLS existence check) still returns an empty rowset. Also validate limit_count >= 1 and cap it at 10000, matching df.list_instances. Add e2e regression test tests/e2e/sql/05_instance_executions.sql.
pinodeca
approved these changes
Jun 12, 2026
pinodeca
left a comment
Contributor
There was a problem hiding this comment.
LGTM; reviewed with Opus 4.8
Minor / non-blocking
- Test file naming: tests/e2e/sql/05_instance_executions.sql duplicates the
05_prefix of the existing 05_monitoring_and_explain.sql, which already tests the monitoring functions. Folding it in there (or using a fresh number) would be tidier. The repo tolerates duplicate numbers (three22_files) and the runner auto-discovers via*.sqlglob into the "standard" phase, so it runs fine — purely cosmetic. - The sibling
metrics()function just below still uses the sameErr(_) => vec![]swallow pattern. Out of scope for #168, but it carries the identical smell if you want a follow-up. - The test's deliberate choice not to assert
status = 'completed'(with the documented rationale aboutdf.instancesvs duroxide per-execution status diverging under BGW load) is well-reasoned and avoids a flaky race.
Verdict
Approve. Solid, well-documented, minimal fix that matches issue #168's accepted resolution, with no security violations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #168.
df.instance_executions()could return no rows for a completed instance, making "this instance genuinely has no execution history" indistinguishable from "the execution-history lookup silently failed."Root cause
The function swallowed every failure path into an empty rowset:
new_backend_provider)list_executionsget_execution_infoEach was
Err(_) => return vec![]. But duroxide-pg writes theinstancesrow and the firstexecutionsrow in the same transaction, so a completed instance always has at least one execution row. An empty result could therefore only mean a silently-swallowed lookup failure.Fix
list_executions/get_execution_infofailures and raise an explicit error (pgrx::error!) instead of returning an empty rowset. The error is raised outsidert.block_on(...)to avoid longjmp-through-tokio, matching the existing pattern indsl.rs/client.rs.limit_count >= 1and cap it at10000, matchingdf.list_instances.Issue #168 explicitly accepts "return an explicit error" as a valid resolution.
Testing
cargo fmt -p pg_durable -- --check— cleancargo build --features pg17— clean (only a pre-existing, feature-gatedextract_hostdead-code warning that is unrelated to this change and absent under CI's feature combo)cargo clippy --no-default-features --features pg17,http-allow-test-domains -- -D warnings— clean (0 warnings)cargo pgrx test pg17(./scripts/test-unit.sh) — 145 passed, 0 failed, 16 ignored./scripts/test-e2e-local.sh— 27 passed, 0 failed, including the new regression testtests/e2e/sql/05_instance_executions.sql