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

Made usage of Path explicit for Edge Worker pid files #43308

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions providers/src/airflow/providers/edge/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
Changelog
---------

0.2.2re0
.........

Misc
~~~~

* ``Fixed type confusion for PID file paths (#43308)``

0.2.1re0
.........

Expand Down
6 changes: 3 additions & 3 deletions providers/src/airflow/providers/edge/cli/edge_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ def _pid_file_path(pid_file: str | None) -> str:
return cli_utils.setup_locations(process=EDGE_WORKER_PROCESS_NAME, pid=pid_file)[0]


def _write_pid_to_pidfile(pid_file_path):
def _write_pid_to_pidfile(pid_file_path: str):
"""Write PIDs for Edge Workers to disk, handling existing PID files."""
if pid_file_path.exists():
if Path(pid_file_path).exists():
# Handle existing PID files on disk
logger.info("An existing PID file has been found: %s.", pid_file_path)
pid_stored_in_pid_file = read_pid_from_pidfile(pid_file_path)
Expand Down Expand Up @@ -142,7 +142,7 @@ class _EdgeWorkerCli:

def __init__(
self,
pid_file_path: Path,
pid_file_path: str,
hostname: str,
queues: list[str] | None,
concurrency: int,
Expand Down
4 changes: 2 additions & 2 deletions providers/src/airflow/providers/edge/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ description: |
Handle edge workers on remote sites via HTTP(s) connection and orchestrates work over distributed sites

state: not-ready
source-date-epoch: 1729588146
source-date-epoch: 1729683247
# note that those versions are maintained by release manager - do not update them manually
versions:
- 0.2.1pre0
- 0.2.2pre0

dependencies:
- apache-airflow>=2.10.0
Expand Down
2 changes: 1 addition & 1 deletion providers/tests/edge/cli/test_edge_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def returncode(self):

@pytest.fixture
def worker_with_job(self, tmp_path: Path, dummy_joblist: list[_Job]) -> _EdgeWorkerCli:
test_worker = _EdgeWorkerCli(tmp_path / "dummy.pid", "dummy", None, 8, 5, 5)
test_worker = _EdgeWorkerCli(str(tmp_path / "dummy.pid"), "dummy", None, 8, 5, 5)
test_worker.jobs = dummy_joblist
return test_worker

Expand Down
2 changes: 1 addition & 1 deletion providers/tests/edge/models/test_edge_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
class TestEdgeWorker:
@pytest.fixture
def cli_worker(self, tmp_path: Path) -> _EdgeWorkerCli:
test_worker = _EdgeWorkerCli(tmp_path / "dummy.pid", "dummy", None, 8, 5, 5)
test_worker = _EdgeWorkerCli(str(tmp_path / "dummy.pid"), "dummy", None, 8, 5, 5)
return test_worker

@pytest.fixture(autouse=True)
Expand Down