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

Load consuming_dags attr eagerly before dataset listener #36247

Conversation

dstandish
Copy link
Contributor

Previously, we could get detached instance error if the dataset listener code closes the session (which happens e.g. if BaseHook.get_connection is called). By eager loading the attribute (which we need anyway), we can avoid this problem.

Previously, we could get detached instance error if the dataset listener code closes the session (which happens e.g. if BaseHook.get_connection is called).  By eager loading the attribute (which we need anyway), we can avoid this problem.
Copy link
Member

@pankajkoti pankajkoti left a comment

Choose a reason for hiding this comment

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

Nice catch and fix!

@ephraimbuddy ephraimbuddy merged commit 5bd3581 into apache:main Dec 16, 2023
52 checks passed
@ephraimbuddy ephraimbuddy deleted the use-joinedload-for-dataset-consuming-dags-attr branch December 16, 2023 08:10
ephraimbuddy pushed a commit that referenced this pull request Dec 16, 2023
Previously, we could get detached instance error if the dataset listener code closes the session (which happens e.g. if BaseHook.get_connection is called).  By eager loading the attribute (which we need anyway), we can avoid this problem.

(cherry picked from commit 5bd3581)
@ephraimbuddy ephraimbuddy added this to the Airflow 2.8.0 milestone Jan 10, 2024
@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants