Fix Edge Worker handles orphaned PID files#43153
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
jscheffl
left a comment
There was a problem hiding this comment.
Thanks for the contribution. That is really a problem I have seen also in my dev if the worker crashed for example if API backend is gone... then the PID file blocked a restart.
Some small requests to improve, otherwise... nice improvement!
|
+1: I see a couple of static checks failing, please run either Note: I'd ignore most of the other errors in the pipeline, seems to be CI general in-stabiltiy) |
|
+1... as we are on main but not releasing the package atm because it is not ready, can you please:
THANKS! |
Co-authored-by: Jens Scheffler <95105677+jscheffl@users.noreply.github.com>
Co-authored-by: Jens Scheffler <95105677+jscheffl@users.noreply.github.com>
Fixed in commit 1d0cb9c |
Fixed in commit 33fb875 |
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
* initial test skeleton * Added safe method for PID file creation * Finished pytests and addressed reviews comments * Fixed merging errors * Update providers/src/airflow/providers/edge/cli/edge_command.py Co-authored-by: Jens Scheffler <95105677+jscheffl@users.noreply.github.com> * Update providers/src/airflow/providers/edge/cli/edge_command.py Co-authored-by: Jens Scheffler <95105677+jscheffl@users.noreply.github.com> * Increased version number of Edge Worker provider * Fixed pytest and fixed merge problems * Fixed findings from breeze static-check --------- Co-authored-by: Jens Scheffler <95105677+jscheffl@users.noreply.github.com>
* Fix Pytest caplog after PR 43153
* initial test skeleton * Added safe method for PID file creation * Finished pytests and addressed reviews comments * Fixed merging errors * Update providers/src/airflow/providers/edge/cli/edge_command.py Co-authored-by: Jens Scheffler <95105677+jscheffl@users.noreply.github.com> * Update providers/src/airflow/providers/edge/cli/edge_command.py Co-authored-by: Jens Scheffler <95105677+jscheffl@users.noreply.github.com> * Increased version number of Edge Worker provider * Fixed pytest and fixed merge problems * Fixed findings from breeze static-check --------- Co-authored-by: Jens Scheffler <95105677+jscheffl@users.noreply.github.com>
* Fix Pytest caplog after PR 43153
* initial test skeleton * Added safe method for PID file creation * Finished pytests and addressed reviews comments * Fixed merging errors * Update providers/src/airflow/providers/edge/cli/edge_command.py Co-authored-by: Jens Scheffler <95105677+jscheffl@users.noreply.github.com> * Update providers/src/airflow/providers/edge/cli/edge_command.py Co-authored-by: Jens Scheffler <95105677+jscheffl@users.noreply.github.com> * Increased version number of Edge Worker provider * Fixed pytest and fixed merge problems * Fixed findings from breeze static-check --------- Co-authored-by: Jens Scheffler <95105677+jscheffl@users.noreply.github.com>
* Fix Pytest caplog after PR 43153
Problem description
The Edge Worker run into the following Exception if the worker was shutdown in a undefined way (No clear shutdown).
The root cause is that the current implementation does not consider, if PID file are already existing.
Also it also does not consider if PID files are created by parallel running Edge Worker instances
Bugfix description
This PR contains code to handle existing PID files for Edge workers:
Changes in details
_write_pid_to_pidfileto Edge Worker CLI that handles PID files in their different life cycles