question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't use Queues w/ `processes=False`

See original GitHub issue

Goal: Share a few small queues between tasks under various Client configurations.

Issue: Using distributed 1.22.0,

from dask.distributed import Client, Queue

client = Client(processes=False)
q = Queue()

def put():
    q.put(55)

def get():
    print(q.get())

fut = client.submit(put)
res = client.submit(get)

results in

Traceback (most recent call last):
  File ".../python3.6/site-packages/distributed/queues.py", line 261, in __setstate__
    assert client.address == address
AttributeError: 'Client' object has no attribute 'address'

...

File ".../python3.6/site-packages/distributed/comm/core.py", line 178, in _raise
    raise IOError(msg)
OSError: Timed out trying to connect to 'inproc://10.0.0.41/16785/7' after 10 s: connect() didn't finish in time

This works as intended when processes=True. I also can’t use queue.Queue because it won’t be pickleable, so I was hoping dask.distributed.Queue would allow me to work around that.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
mrocklincommented, Aug 29, 2018

Possibly resolved in https://github.com/dask/distributed/pull/2221

This is also the sort of thing for which it would be nice to have an explicit Semaphore object. There is https://github.com/dask/distributed/issues/2007 if you ever feel like diving into the guts of the distributed scheduler. It’s a decent entry issue.

1reaction
mrocklincommented, Aug 29, 2018

Replicated. Thanks for the minimal bug report Chris. I’ll take a look.

I’m also curious, what is your intended application here?

On Wed, Aug 29, 2018 at 1:30 PM, Chris White notifications@github.com wrote:

Goal: Share a few small queues between tasks under various Client configurations.

Issue: Using distributed 1.22.0,

from dask.distributed import Client, Queue

client = Client(processes=False) q = Queue() def put(): q.put(55) def get(): print(q.get())

fut = client.submit(put) res = client.submit(get)

results in

Traceback (most recent call last): File “…/python3.6/site-packages/distributed/queues.py”, line 261, in setstate assert client.address == addressAttributeError: ‘Client’ object has no attribute ‘address’ …

File “…/python3.6/site-packages/distributed/comm/core.py”, line 178, in _raise raise IOError(msg)OSError: Timed out trying to connect to ‘inproc://10.0.0.41/16785/7’ after 10 s: connect() didn’t finish in time

This works as intended when processes=True. I also can’t use queue.Queue because it won’t be pickleable, so I was hoping dask.distributed.Queue would allow me to work around that.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dask/distributed/issues/2220, or mute the thread https://github.com/notifications/unsubscribe-auth/AASszDUDbynET6_FSB54riE7L8JiWy2Rks5uVs_AgaJpZM4WSAGM .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wait queues – CS 161 doc
Processes often wait for external events. Your editor waits for key presses; your browser waits for interactions (and/or animations); web servers wait for ......
Read more >
Python - Multiprocessing Queue not returning result in correct ...
The main issue with your code is that you're expecting to start workers and collect results in one loop. Forget about it whenever...
Read more >
17.2. multiprocessing — Process-based parallelism
Returns a process shared queue implemented using a pipe and a few locks/semaphores. When a process first puts an item on the queue...
Read more >
Cuda error · Issue #664 · dbolya/yolact - GitHub
In my project, I use ' torch.set_default_tensor_type('torch.cuda. ... A process won't hang when putting into a queue; ] # for more details.
Read more >
To Queue Or Not To Queue - Medium
The software that runs your operating system has its own queues of processes that have to run at any given time. But, generally,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found