python - Dask Future 的状态为“已取消”,但未被取消
问题描述
我正在构建一个 dask 应用程序并将 Dask SSH-Cluster 用作集群。当我在 Dask 中运行任务并尝试等待它时,它会导致concurrent.futures._base.CancelledError
错误。
我的代码如下:
def run_custom_task():
return "aa"
def main():
cluster = SSHCluster(hosts=['localhost', 'pi01.local'],
connect_options=[{'username': 'abc'}, {'username': 'pi'}],
worker_options={
"nprocs": 1,
"nthreads": 1
},
remote_python="/usr/bin/python3")
client = Client(cluster)
res = client.submit(run_custom_task)
print(res.result())
我收到的确切错误是:
Traceback (most recent call last):
File "test.py", line 65, in <module>
main()
File "test.py", line 59, in main
x = res.result()
File "/home/rohan/.local/lib/python3.8/site-packages/distributed/client.py", line 222, in result
raise result
concurrent.futures._base.CancelledError: run_custom_task-966de894af6e709f1e8067f6e9ffe68
所以似乎这项任务的未来正在以某种方式被取消。
提前致谢!
解决方案
我实际上已经设法解决了这个问题:问题是安装相同版本后 dask.distributed 和 dask 版本不同(2021.04.0 和 2021.05.0),此错误已解决。
推荐阅读
- javascript - 基于至少两个参数的复杂决策
- java - 如何解决'线程“主”java.lang.NullPointerException中的异常'
- wordpress - Woocommerce PHP - 将产品图片添加到页面
- php - 将 WordPress 数据库表导出到包含所有元信息的 excel 文件
- php - Cake PHP 2 模型与查找器查询的关联
- python - how to replace XML values with values from a list
- node.js - MongoError:拓扑被破坏,NODEJS
- python - 容器以非零退出代码 143 退出。被外部信号杀死
- python - 如何使用 Python 将一系列重复的数据行转换为多条记录的列?
- java - JMSCMQ0001:WebSphere MQ 调用失败,compcode '2' ('MQCC_FAILED') 原因 '2009' ('MQRC_CONNECTION_BROKEN')