Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

While registering a scheduler plugin get TypeError: PooledRPCCall.__getattr__.<locals>.send_recv_from_rpc() takes 0 positional arguments but 1 was given

オープン
#9,001 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python

調査の方向性

distributed/core.py の PooledRPCCall.getattr から始め、issue 内の scheduler-plugin の例を実行して Scheduler.add_plugin からの TypeError を再現します。生成された RPC callable の呼び出しを追跡し、位置引数エラーなしで例がプラグインを正常に登録できることを確認します。リポジトリに適切なテスト場所がある場合は、このパスのリグレッションカバレッジも追加します。

索引モデルが issue の本文から書いたものです。

説明

bug regression

Describe the issue:

When registering a Dask scheduler plugin via Scheduler.add_plugin, we get the following error:

TypeError: PooledRPCCall.__getattr__.<locals>.send_recv_from_rpc() takes 0 positional arguments but 1 was given

The offending code is in distributed's core.py:

     def __getattr__(self, key):
        async def send_recv_from_rpc(**kwargs): # THIS IS WHERE THE ERROR IS RAISED
            if self.serializers is not None and kwargs.get("serializers") is None:
                kwargs["serializers"] = self.serializers
            if self.deserializers is not None and kwargs.get("deserializers") is None:
                kwargs["deserializers"] = self.deserializers
            comm = await self.pool.connect(self.addr)
            prev_name, comm.name = comm.name, "ConnectionPool." + key
            try:
                return await send_recv(comm=comm, op=key, **kwargs)
            finally:
                self.pool.reuse(self.addr, comm)
                comm.name = prev_name

Minimal Complete Verifiable Example:

Taken from your own example of a scheduler plugin, which DOES NOT WORK NOW.

from distributed import Client, LocalCluster, SchedulerPlugin

class MySchedulerPlugin(SchedulerPlugin):
    def __init__(self):
        self.counter = 0

    def transition(self, key, start, finish, *args, **kwargs):
        if start == 'processing' and finish == 'memory':
            self.counter += 1

    def restart(self, scheduler):
        self.counter = 0

if __name__ == '__main__':
    with Client() as client:
        print(f'scheduler={client.scheduler}')
        my_scheduler_plugin = MySchedulerPlugin()
        client.scheduler.add_plugin(my_scheduler_plugin)
    print('Done')

This produces the following;

scheduler=<pooled rpc to 'tcp://127.0.0.1:57991'>
Traceback (most recent call last):
  File "/Users/may/Projects/scratch/dask_scheduler/scheduler.py", line 22, in <module>
    client.scheduler.add_plugin(my_scheduler_plugin)
TypeError: PooledRPCCall.__getattr__.<locals>.send_recv_from_rpc() takes 0 positional arguments but 1 was given

Anything else we need to know?:
N/A

Environment:

  • Dask version:
dask                    2024.10.0
distributed             2024.10.0

And the same behavior observed for 2024.11.2

  • Python version: 3.10.15 and 3.11.7
  • Operating System:
    • Darwin mac135909 24.2.0 Darwin Kernel Version 24.2.0: Fri Dec 6 18:56:34 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6020 arm64
    • Linux login05 5.14.21-150500.55.49_13.0.57-cray_shasta_c #1 SMP Sun May 12 13:35:37 UTC 2024 (33add2b) x86_64 x86_64 x86_64 GNU/Linux
  • Install method (conda, pip, source):
    • conda and pip
主要言語
Python
スター
1.7k
フォーク
780
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

dask/distributed のほかの issue

dask/distributed の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。