dask / distributed

A distributed task scheduler for Dask
https://distributed.dask.org
BSD 3-Clause "New" or "Revised" License
1.57k stars 719 forks source link

Client API throws up AttributeError #5163

Closed srib closed 2 years ago

srib commented 3 years ago

What happened:

asyncio throws up an error: AttributeError: 'NoneType' object has no attribute 'get_ident'

What you expected to happen:

The application to run without any errors.

Minimal Complete Verifiable Example:


import time 
import random

from dask_gateway import Gateway

GATEWAY_ADDRESS = "http://10.18.1.228"

gateway = Gateway(address=GATEWAY_ADDRESS)

# Create a new cluster
cluster = gateway.new_cluster()

# Allocate a few workers to the cluster 
cluster.adapt(3, 24)

client = cluster.get_client()

def inc(a):
    time.sleep(random.randint(2, 3))
    return a+1

a = range(0, 100, 1)
L = client.map(inc, a)
print(L)

total = client.submit(sum, L)
print(total)

print(client.gather(total))

client.close()
cluster.shutdown()

Anything else we need to know?:

The MVE runs fine. total gets printed before the AttributeErrors are printed to the screen.

Environment:

srib commented 3 years ago

Related: #4305

jrbourbeau commented 3 years ago

Thanks for raising an issue @srib. The related issue you linked to https://github.com/dask/distributed/issues/4305 was resolved by https://github.com/dask/distributed/pull/4309 which was included in the distributed=2021.01.0 release. Could you update your dask and distributed version and try again?

srib commented 3 years ago

@jrbourbeau Thanks for the quick response. I have to update my dask-gateway image. Let me try it and report.

jrbourbeau commented 2 years ago

Just checking in, @srib were you able to update your distributed release and try again?

srib commented 2 years ago

Thanks for the prompt follow-up @jrbourbeau. I was able to resolve it by keeping consistent versions between the client, workers and the scheduler.

I will close this issue and follow-up in case I need any further help.