Skip to content

fix(demo): release materialization claims after rollback - #434

Merged
suguanYang merged 1 commit into
mainfrom
fix/wangbinqi/materialization-claim-cleanup
Sep 23, 2026
Merged

suguanYang merged 1 commit into
mainfrom
fix/wangbinqi/materialization-claim-cleanup

Conversation

@suguanYang

Copy link
Copy Markdown
Contributor

Summary

  • capture demo materialization claim IDs before publication begins
  • release claims by stable IDs after a rollback instead of reading expired ORM instances
  • preserve the original publication exception rather than masking it with SQLAlchemy MissingGreenlet

Context

A production demo-spacex-s1 materialization exceeded the database command timeout. The rollback expired the in-memory claim objects, and failure cleanup then read claim.id, causing SQLAlchemy to attempt async I/O outside greenlet_spawn. That secondary MissingGreenlet hid the original timeout and could leave the materialization claim until stale-claim recovery.

This PR fixes the failure cleanup only. It does not change the materialization database timeout or the bulk publication workload.

Validation

  • uv run pytest apps/api/tests/contract/test_demo_documents_contract.py -q — 11 passed
  • uv run ruff check apps/api/app/services/demo/source_materializer.py apps/api/tests/contract/test_demo_documents_contract.py
  • uv run pyright apps/api/app/services/demo/source_materializer.py apps/api/tests/contract/test_demo_documents_contract.py
  • git diff --check

@suguanYang
suguanYang merged commit 249abf6 into main Sep 23, 2026
6 checks passed
@EricNGOntos EricNGOntos mentioned this pull request Sep 23, 2026
1 task
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