-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ERROR] asyncio.exceptions.CancelledError #1532
Comments
Hi @xmyhhh, It would be helpful if you could provide more context:
Best, |
Hi @xmyhhh, I did some experimenting and the fix is Not sure why the newest dask versions break things but that's a fix I have for you right now |
Did some more thinking as to why this wasn't an issue. I used this example as a test and I'm surprised this didn't trigger for any of the tests, needs to be investigated a little further |
I'll hot patch this later today :) |
No longer going to hotpatch this, I thought this was a breaking issue in which autosklearn no longer function but instead it's just seems to be an error with logging within dask while we close down the dask I'll keep a running log here as I debug it as it's likely going to take a lot of trial and error to fix and I don't have deep time to dedicate. |
First thing to note is that Can confirm that it happens when we try to auto-sklearn/autosklearn/automl.py Lines 378 to 379 in 4f691a1
At first I thought it might be reference issue where the scheduler gets collected too early since it has no named reference outside of auto-sklearn/autosklearn/automl.py Lines 355 to 372 in 4f691a1
Might be worth closing down the scheduler using Quick check also confirmed there are no pending futures before the Tried to naively just use Doesn't seem to be anything on dask about this coming up. Next suggestionsMain thing would be to identify the futures which give the CancelledError. It would also be good to create a minimal example of the above creation of the dask client, submit a job or two and then do our shutdown process and see if the problem is minimally reporducible.
|
I can't believe you replied so much, thanks so much but I need a moment to check your reply~ |
So I got back to this and created a minimal example that solves the issue. Essentially Essentially, when In the broken example, we can see # Recreate broken
from dask.distributed import Client, LocalCluster
class A:
def do(self):
print("setup", flush=True)
self.client = Client(LocalCluster(n_workers=2, processes=False))
print(f"post creation | self.client.status = {self.client.status}", flush=True)
self.client.shutdown()
print(f"post shutdown | self.client.status = {self.client.status}", flush=True)
a = A()
a.do()
# setup
# post creation | self.client.status = running
# post shutdown | self.client.status = connecting
# `a` goes out of scope, self.client.__del__ is called, `Client` is "connecting", close again
# ...errors # Fixed
from dask.distributed import Client, LocalCluster
class A:
def do(self):
print("setup", flush=True)
self.cluster = LocalCluster(n_workers=2, processes=False)
self.client = Client(self.cluster)
print(f"post creation | self.client.status = {self.client.status}", flush=True)
print(f"post creation | self.cluster.status = {self.cluster.status}", flush=True)
self.client.close()
self.cluster.close()
print(f"post shutdown | self.client.status = {self.client.status}", flush=True)
print(f"post shutdown | self.cluster.status = {self.cluster.status}", flush=True)
a = A()
a.do()
# setup
# post creation | self.client.status = running
# post creation | self.cluster.status = Status.running
# post shutdown | self.client.status = closed
# post shutdown | self.cluster.status = Status.closed
# # `a` goes out of scope, self.client.__del__ is called, `Client` is "closed", do nothing This means since we create our own cluster, we are in charge of shutting it down, not the client. Or so that's what I gather from this. |
The program throws an error at runtime, how can this error be solved?
The text was updated successfully, but these errors were encountered: