fix: members-enrichment workflow timeouts and db savepoint errors#3585
Conversation
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
1 similar comment
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
69c0e64 to
87d60d5
Compare
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
1 similar comment
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
There was a problem hiding this comment.
Pull Request Overview
This PR addresses transaction handling issues and adjusts workflow timeouts to accommodate sequential database operations in the member enrichment worker. The primary changes involve refactoring the deleteMemberOrgById function to accept a transaction directly (avoiding nested savepoints) and converting parallel database operations to sequential execution.
Key changes:
- Refactored
deleteMemberOrgByIdto acceptDbTransactiondirectly instead of creating nested transactions - Increased workflow execution timeouts across the enrichment pipeline (ranging from 2x to 6x increases)
- Converted parallel database operations to sequential execution in
updateMemberUsingSquashedPayload
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| services/libs/data-access-layer/src/old/apps/members_enrichment_worker/index.ts | Modified deleteMemberOrgById to accept transaction directly and avoid nested savepoints |
| services/apps/members_enrichment_worker/src/workflows/getMembersToEnrich.ts | Increased activity timeout from 10 to 15 minutes and workflow timeout from 15 to 30 minutes |
| services/apps/members_enrichment_worker/src/workflows/enrichMember.ts | Increased activity timeout from 5 to 10 minutes and workflow timeout from 15 to 25 minutes |
| services/apps/members_enrichment_worker/src/schedules/getMembersToEnrich.ts | Increased schedule workflow timeout from 20 minutes to 2 hours |
| services/apps/members_enrichment_worker/src/activities/enrichment.ts | Converted parallel database operations to sequential execution throughout member update process |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Changes
Parent timeouts were cancelling child workflows, and parallel database mutations inside a single transaction caused “savepoint does not exist” and “current transaction is aborted” errors under failure conditions.
I increased the schedule, child, and activity timeouts to allow the enrichment batch and its children to complete within a reasonable window. Also serialized the member update operations within the transaction and adjusted the DAL call path to execute deletes on the provided transaction, avoiding nested savepoints.
This removes the cancellation/timing pressure and eliminates the savepoint errors while keeping behavior unchanged.