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.

io_loop error when running Dask Actors on SGECluster

See original GitHub issue

What happened: Getting an error when trying to submit an Actor to a client started with an SGECluster cluster.

Using example code found here. Works fine with a LocalCluster . I get an io_loop error when running with an SGECluster.

Error:

AttributeError: type object 'Counter' has no attribute '_io_loop'

What you expected to happen: I expect the Dask Actor to work on an SGECluster

Minimal Complete Verifiable Example:

Example:

class Counter:
    """ A simple class to manage an incrementing counter """
    n = 0

    def __init__(self):
        self.n = 0

    def increment(self):
        self.n += 1
        return self.n

    def add(self, x):
        self.n += x
        return self.n

future = client.submit(Counter, actor=True)  # Create a Counter on a worker
counter = future.result()

counter.add(1)

Error:

AttributeError                            Traceback (most recent call last)
Input In [6], in <cell line: 1>()
----> 1 counter.add(1)

    211         return _OK(result["result"])
    212     return _Error(result["exception"])
--> 214 actor_future = ActorFuture(io_loop=self._io_loop)
    216 async def wait_then_set_result():
    217     actor_future._set_result(await run_actor_function_on_worker())

    187     else:
    188         return attr
--> 190 attr = getattr(self._cls, key)
    192 if callable(attr):
    194     @functools.wraps(attr)
    195     def func(*args, **kwargs):

AttributeError: type object 'Counter' has no attribute '_io_loop'

Anything else we need to know?:

Environment:

  • Dask version: 2022.5.0
  • Dask-jobqueue: 0.7.3
  • Python version: 3.8.13
  • Operating System: CentOs
  • Install method (conda, pip, source): conda

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
graingertcommented, May 30, 2022
0reactions
mrondacommented, May 30, 2022

@graingert I think I fixed it! I had set set_as_default=False when starting my Client. I set that to True and now it does set Actor._client.io_loop . Thanks for the help ! You pointed me to some code that allowed me to debug that further

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cancelling task waiting on event breaks tornado #3908 - GitHub
The task to cancel silently. Minimal Complete Verifiable Example: Run on jupyter lab 2.1.4, on a cell block. PS: does not produce error...
Read more >
Creating a Dask client results in endless loop of errors
When I run this code:
Read more >
dask_jobqueue.SGECluster - Dask-Jobqueue
A dask.distributed security object if you're using TLS/SSL. If True, temporary self-signed credentials will be created automatically. scheduler_optionsdict.
Read more >
Futures - Dask documentation
Once an actor is running on a worker it is forever tied to that worker. If that worker becomes overburdened or dies, then...
Read more >
API — Dask.distributed 2022.12.1 documentation
Run a benchmark on the workers for memory, disk, and network bandwidths ... Whether these tasks should exist on the worker as stateful...
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