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

Allow PID file path to be relative when daemonize a process (scheduler, kerberos, etc) #13232

Merged
merged 1 commit into from
Dec 22, 2020

Conversation

XD-DENG
Copy link
Member

@XD-DENG XD-DENG commented Dec 21, 2020

Closes #13200 (please refer to #13200 for detailed background and discussion.)

Currently, if the PID file path provided is relative, the process silently fails to launch.

This fix ensures the path specified to be a normalized absolutized path eventually (expand with cwd), no matter the given value is relative or absolute.

This PR also tries to increase coverage a little bit.


^ 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.

@XD-DENG XD-DENG added area:CLI type:bug-fix Changelog: Bug Fixes labels Dec 21, 2020
@XD-DENG XD-DENG added this to the Airflow 2.0.1 milestone Dec 21, 2020
@XD-DENG XD-DENG changed the title Enforce PID file path to be absolute when demonize a process (like scheduler, etc) Enforce PID file path to be absolute when deamonize a process (like scheduler, etc) Dec 21, 2020
airflow/utils/cli.py Outdated Show resolved Hide resolved
@XD-DENG XD-DENG marked this pull request as draft December 21, 2020 22:10
@XD-DENG XD-DENG marked this pull request as ready for review December 21, 2020 22:10
@XD-DENG XD-DENG changed the title Enforce PID file path to be absolute when deamonize a process (like scheduler, etc) Allow PID file path to be relative when deamonize a process (scheduler, kerberos, etc) Dec 22, 2020
@XD-DENG
Copy link
Member Author

XD-DENG commented Dec 22, 2020

This PR is updated to adopt different solution, based on the latest discussion in #13200 .

@XD-DENG XD-DENG requested review from ashb, turbaszek and potiuk December 22, 2020 18:18
@XD-DENG XD-DENG changed the title Allow PID file path to be relative when deamonize a process (scheduler, kerberos, etc) Allow PID file path to be relative when daemonize a process (scheduler, kerberos, etc) Dec 22, 2020
…r, kerberos, etc)

Closes apache#13200.

Currently, if the PID file path provided is relative,
the process silently fails to launch.

This fix ensures the PID path specified to be
a normalized absolutized path eventually (expand with cwd),
no matter the given value is relative or absolute.
@XD-DENG
Copy link
Member Author

XD-DENG commented Dec 22, 2020

@ashb any further inputs before we merge this?

@github-actions
Copy link

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 master at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Dec 22, 2020
@XD-DENG XD-DENG merged commit 93e4787 into apache:master Dec 22, 2020
@XD-DENG XD-DENG deleted the issue-13200 branch December 22, 2020 22:19
kaxil pushed a commit to astronomer/airflow that referenced this pull request Dec 23, 2020
…r, kerberos, etc) (apache#13232)

Closes apache#13200.

Currently, if the PID file path provided is relative,
the process silently fails to launch.

This fix ensures the PID path specified to be
a normalized absolutized path eventually (expand with cwd),
no matter the given value is relative or absolute.

(cherry picked from commit 93e4787)
kaxil pushed a commit that referenced this pull request Jan 21, 2021
…r, kerberos, etc) (#13232)

Closes #13200.

Currently, if the PID file path provided is relative,
the process silently fails to launch.

This fix ensures the PID path specified to be
a normalized absolutized path eventually (expand with cwd),
no matter the given value is relative or absolute.

(cherry picked from commit 93e4787)
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.

CLI airflow scheduler -D --pid <PIDFile> fails silently if PIDFile given is a relative path
4 participants