Skip to content

Commit

Permalink
multiprocessing scheduler silently hangs with lock task argument
Browse files Browse the repository at this point in the history
Signed-off-by: Nir Izraeli <nirizr@gmail.com>
  • Loading branch information
nirizr committed Jun 29, 2016
1 parent f460b5d commit 21f65c3
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions dask/tests/test_multiprocessing.py
Expand Up @@ -46,6 +46,35 @@ def test_errors_propagate():
assert "12345" in str(e)


global_lock = multiprocessing.Lock()
def lock_func(i, l):
# we don't even have to use the lock to hang

return i

@pytest.mark.timeout(10)
@pytest.mark.xfail(reason="passing multiprocessing locks as dask task arguments "
"hangs dask on call to _get")
def test_lock():
dsk = {'x': (lock_func, 42, global_lock)}

assert get(dsk, 'x') == 42


def global_lock_func(i):
# we don't even have to use the lock to hang

global_lock.acquire()
global_lock.release()

return i

def test_global_lock():
dsk = {'x': (global_lock_func, 42)}

assert get(dsk, 'x') == 42


def make_bad_result():
return lambda x: x + 1

Expand Down

0 comments on commit 21f65c3

Please sign in to comment.