【问题标题】:Dask Future has state "cancelled" without having been cancelledDask Future 的状态为“已取消”,但未被取消
【发布时间】:2021-08-07 18:37:13
【问题描述】:

我正在构建一个 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

所以看来这项任务的未来正在以某种方式被取消。

提前致谢!

【问题讨论】:

    标签: python dask dask-distributed concurrent.futures dask-ssh


    【解决方案1】:

    我实际上已经设法解决了这个问题: 问题是 dask.distributed 和 dask 版本不同(2021.04.0 和 2021.05.0)安装同一个版本后这个错误解决了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-21
      • 1970-01-01
      相关资源
      最近更新 更多