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.

Wait for workers to join before continuing

See original GitHub issue

Moved from dask/dask-kubernetes#87

It would be useful to have the cluster.scale() method block until the workers join. This was originally raised in dask-kubernetes but is applicable to dask-jobqueue and dask-yarn so would make more sense to implement here.

Suggestions from @mrocklin:

One solution here might be to use SchedulerPlugins to explicitly trigger events whenever a new worker reaches the scheduler. Calling wait on the cluster object might register a tornado.locks.Event or tornado.locks.Condition that gets triggered when the right number of workers have arrived.

@jhamman implemented a SchedulerPlugin for dask-jobqueue in order to improve adaptive operation (he wanted adaptive to be aware of pending jobs). This work happened in dask/dask-jobqueue#63 and might be the sort of thing we could think about generalizing. Any thoughts on this @jhamman?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:17 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
mrocklincommented, Aug 3, 2018

I think it would make sense to have an explicit wait method or wait= keyword to scale that would allow a user to opt-in to blocking semantics. I would use this for benchmarking.

1reaction
mrocklincommented, Mar 4, 2019

In case someone wanted to use wait from within an asynchronous environment.

async with SGECluster(...) as cluster:
    cluster.scale(10)
    await cluster.wait()
    x.compute()
Read more comments on GitHub >

github_iconTop Results From Across the Web

JS Worker await message before continuing - Stack Overflow
I want to wait for the response before continuing the worker because the response contains the information I need (memoryAvailable).
Read more >
API — Dask.distributed 2022.12.1 documentation
Client ([address, loop, timeout, ...]) Connect to and submit computation to a Dask cluster ... Blocking call to wait for n workers before...
Read more >
Multiprocessing Pool Wait For All Tasks To Finish in Python
You can wait for tasks issued to the multiprocessing pool to complete by calling AsyncResult.wait() or calling Pool.join().
Read more >
Frequently Asked Questions | Fair Hearings | OTDA - NY.gov
Will I continue to receive my benefits while I'm waiting for my hearing? ... and you ask for a Fair Hearing before the...
Read more >
Coroutines and Tasks — Python 3.11.1 documentation
Coroutines declared with the async/await syntax is the preferred way of writing ... be awaited to wait until it is complete: await task...
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