Skip to content

Dispose not used connection pool#21565

Merged
jedcunningham merged 1 commit into
apache:mainfrom
pingzh:pingzh-dispose-orm
Feb 15, 2022
Merged

Dispose not used connection pool#21565
jedcunningham merged 1 commit into
apache:mainfrom
pingzh:pingzh-dispose-orm

Conversation

@pingzh

@pingzh pingzh commented Feb 14, 2022

Copy link
Copy Markdown
Contributor

In the task_run, it has to dispose the ORM then configure orm, otherwise, the existing db connection won't be closed. When there are lots of running tasks, the DB is likely to get connection error.

Test:

before the change

i put a time.sleep(1000) right after the settings.configure_orm(disable_connection_pool=True)

image

After the change

i put a time.sleep(1000) right after the settings.reconfigure_orm(disable_connection_pool=True)

image


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

@github-actions github-actions Bot added the full tests needed We need to run full set of tests for this PR to merge label Feb 14, 2022
@github-actions

Copy link
Copy Markdown
Contributor

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@pingzh
pingzh force-pushed the pingzh-dispose-orm branch from 182a8d7 to 41a9c1e Compare February 14, 2022 21:26
@jedcunningham
jedcunningham merged commit 8155e8a into apache:main Feb 15, 2022
@jedcunningham jedcunningham added the type:bug-fix Changelog: Bug Fixes label Feb 15, 2022
@pingzh
pingzh deleted the pingzh-dispose-orm branch February 15, 2022 17:43
@jedcunningham jedcunningham added this to the Airflow 2.2.5 milestone Mar 22, 2022
ephraimbuddy pushed a commit that referenced this pull request Mar 23, 2022
ephraimbuddy pushed a commit that referenced this pull request Mar 24, 2022
ephraimbuddy pushed a commit that referenced this pull request Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:CLI full tests needed We need to run full set of tests for this PR to merge type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants