Skip to content

Conversation

@maneesh29s
Copy link
Contributor

Closes #9112

  • Tests added / passed
  • Passes pre-commit run --all-files

Here I have implemented one of the proposed ways: Using the worker.name to generate the default threadpool name.

My doubts: The thread name might get longer. Will that affect anything? I am not sure if operating system has any limit on the size of thread name.

@maneesh29s maneesh29s requested a review from fjetter as a code owner September 30, 2025 18:03
@maneesh29s
Copy link
Contributor Author

The test that I have written is simply a copy of the test just above it, test_multiple_executors , with one change that I am also passing worker name.
Instead should we merge these 2 tests?

@github-actions
Copy link
Contributor

github-actions bot commented Sep 30, 2025

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

    27 files  ± 0      27 suites  ±0   9h 27m 3s ⏱️ - 8m 43s
 4 112 tests + 1   4 002 ✅  -  1    104 💤 ±0  6 ❌ +3 
51 516 runs  +12  49 326 ✅ +10  2 184 💤 ±0  6 ❌ +3 

For more details on these failures, see this check.

Results for commit e433592. ± Comparison against base commit 8e604a0.

♻️ This comment has been updated with latest results.

Copy link
Member

@jacobtomlinson jacobtomlinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for implementing this. I agree about the name length concern.

This post seems to suggest that the linux kernel has a max length of 16 chars for thread names. Our current prefix already exceeds this so I assume it's not a problem. It seems that Python just sets the name as a string in threading.Thread(name=...), which means we can set it to whatever we like. I can't find any documentation that mentions a maximum length.

As we are both concerned about this I would recommend adding another test that creates a worker with a crazy long name. That would give us confidence that it's fine. You could merge the two existing tests into one, and then add a new one that explicitly tests a long name.

@maneesh29s
Copy link
Contributor Author

I have added a check for very long worker name.

Also I have decided not to merge those 2 tests i.e. test_multiple_executors and the new test_executor_inherit_threadname_from_worker, since they test different functionality.

The test_multiple_executors also tests for a scenario when worker name is not provided by the user.

Copy link
Member

@jacobtomlinson jacobtomlinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me!

@maneesh29s
Copy link
Contributor Author

The failing tests don't seem relevant to my PR here. Is there something I have to do from my end ?

@jacobtomlinson
Copy link
Member

I agree flaky tests are unrelated

@jacobtomlinson jacobtomlinson merged commit c9e7aca into dask:main Oct 2, 2025
27 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow renaming worker ThreadPool's thread_name_prefix from worker parameters

2 participants