Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Course enrollment change transaction handling #1

Merged

Conversation

Ang-m4
Copy link
Collaborator

@Ang-m4 Ang-m4 commented Feb 6, 2025

Description:

An issue was detected in the asynchronous execution of tasks related to the Course enrollment logic in the plugin. There is a chance that the model query runs before the object is committed to the database. Since the view triggering the task is wrapped in an atomic operation, the task may execute before the commit is finalized, resulting in the object being unavailable.

More information about this issue can be found here, While the community is exploring an alternative approach to sink integration, we will address the issue by adjusting the precise timing of the task execution.

Proposed Change:

We propose modifying the task execution so that it occurs only after the transaction has been fully committed. By leveraging the transaction.on_commit method, we can wrap the task call to ensure it executes only once the database has been successfully updated

Copy link

github-actions bot commented Feb 6, 2025

Coverage report

This PR does not seem to contain any modification to coverable code.

@Ang-m4 Ang-m4 force-pushed the afg/dump-data-to-clickhouse-async-fix branch from ae00133 to a7af9aa Compare February 6, 2025 15:00
@Ang-m4 Ang-m4 requested a review from andrey-canon February 6, 2025 15:41
@andrey-canon andrey-canon changed the base branch from main to open-release/redwood.nelp February 6, 2025 16:17
@Ang-m4 Ang-m4 force-pushed the afg/dump-data-to-clickhouse-async-fix branch from a7af9aa to c345574 Compare February 6, 2025 18:15
@Ang-m4 Ang-m4 force-pushed the afg/dump-data-to-clickhouse-async-fix branch from c345574 to 690dc72 Compare February 6, 2025 18:36
@Ang-m4 Ang-m4 changed the title Retry mechanism for dump_data_to_clickhouse task Add Course enrollment change transaction handling Feb 6, 2025
@Ang-m4
Copy link
Collaborator Author

Ang-m4 commented Feb 6, 2025

Hi @andrey-canon , I just updated the approach for post-transactional task execution. Please let me know if any further adjustments are needed.

Copy link

@andrey-canon andrey-canon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Ang-m4 Ang-m4 merged commit 8202f13 into open-release/redwood.nelp Feb 6, 2025
9 checks passed
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.

2 participants