Skip to content

Commit

Permalink
Fail if scheduler starts with '-' in dask-cuda-worker(#485)
Browse files Browse the repository at this point in the history
Fixes #472

Authors:
  - Peter Andreas Entschev <[email protected]>

Approvers:
  - Mads R. B. Kristensen

URL: #485
  • Loading branch information
pentschev authored Jan 5, 2021
1 parent b170b29 commit 32d9d33
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dask_cuda/cli/dask_cuda_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,13 @@ def main(
else:
security = None

if isinstance(scheduler, str) and scheduler.startswith("-"):
raise ValueError(
"The scheduler address can't start with '-'. Please check "
"your command line arguments, you probably attempted to use "
"unsupported one. Scheduler address: %s" % scheduler
)

worker = CUDAWorker(
scheduler,
host,
Expand Down
7 changes: 7 additions & 0 deletions dask_cuda/tests/test_dask_cuda_worker.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import absolute_import, division, print_function

import os
import subprocess

import pytest

Expand Down Expand Up @@ -98,3 +99,9 @@ def test_rmm_managed(loop): # noqa: F811
)
for v in memory_resource_type.values():
assert v is rmm.mr.ManagedMemoryResource


def test_unknown_argument():
ret = subprocess.run(["dask-cuda-worker", "--my-argument"], capture_output=True)
assert ret.returncode != 0
assert b"Scheduler address: --my-argument" in ret.stderr

0 comments on commit 32d9d33

Please sign in to comment.