Skip to content

Allow renaming worker ThreadPool's thread_name_prefix from worker parameters #9112

Closed

Description

@maneesh29s

The distributed ThreadPoolExecutor sets the name of each thread based on thread_name_prefix parameter.

The dask worker, by default, passes a fixed name Dask-Default-Threads as the thread_name_prefix
Corresponding code in dask worker which sets name

Dask's worker parameters only allow overriding the executor, but since executor has to be an instance of some Executor (i.e. its a python object), we can't pass this object from outside of python,
for example, when passing "worker json spec" to the dask spec command to start a worker.

If we can allow user to override this thread_name_prefix of the default executor, by adding one more parameter in the worker params which accepts a string, that would be useful.

Also on another note, the default name of the worker threadpool, can be derived from the worker's self.name attribute itself, rather than always defaulting to Dask-Default-Threads

Activity

  1. added
    enhancement
    and removed on Sep 15, 2025
  2. maneesh29s commented on Sep 17, 2025

    @maneesh29s
    ContributorAuthor

    I would be happy to raise MR for this. But I would like to know which approach will be better.

    1. Add a new parameter to Worker to override threadpool name
    2. Use the worker.name to generate the default threadpool name, like {worker.name}-Thread
    3. Do both 1 and 2
  3. jacobtomlinson commented on Sep 18, 2025

    @jacobtomlinson
    Member

    I don't have any strong feelings either way.

    Someone else might chime in here later, but I would suggest you move forward with whichever approach would be most helpful to you as a user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions