You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "wenjin272 (via GitHub)" <gi...@apache.org> on 2026/08/14 03:13:12 UTC
[I] [Feature] Use descriptive thread names for Java and Python async executors [flink-agents]
wenjin272 opened a new issue, #1013:
URL: https://github.com/apache/flink-agents/issues/1013
### Search before asking
- [x] I searched in the [issues](https://github.com/apache/flink-agents/issues) and found nothing similar.
### Description
Flink Agents currently relies on the default thread names for both Java and Python asynchronous execution:
- The JDK 21 Java implementation creates its executor with `Executors.newFixedThreadPool(numAsyncThreads)`, so worker threads have generic names such as `pool-N-thread-M`.
- The Python implementation creates a `ThreadPoolExecutor` without `thread_name_prefix`, so worker threads have generic names such as `ThreadPoolExecutor-N_M`.
These names make it difficult to identify Flink Agents async workers in TaskManager thread dumps, profiler output, and monitoring tools. A TaskManager process may contain many unrelated executor pools, and the current names do not indicate whether a thread belongs to the Flink Agents Java async executor, the Python async executor, or another component. Idle workers are especially difficult to attribute because their stacks contain only generic `ThreadPoolExecutor` frames.
Both executors should use descriptive, collision-resistant thread names. The naming convention should:
- clearly identify the thread as a Flink Agents async worker;
- distinguish Java and Python executor threads;
- distinguish different executor instances and workers within the same process; and
- remain useful in thread dumps and profiler output without changing execution behavior.
For example, names could follow conventions similar to:
- Java: `flink-agents-java-async-<pool-id>-thread-<worker-id>`
- Python: `flink-agents-python-async-<pool-id>_<worker-id>`
The exact convention can be decided during implementation. Java can provide a custom `ThreadFactory` when constructing the fixed thread pool, while Python can provide a unique `thread_name_prefix` to `ThreadPoolExecutor`.
Tests should verify that tasks submitted to each executor run on threads with the expected descriptive prefix and that names remain distinct across multiple executor instances.
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Feature] Use descriptive thread names for Java and Python async executors [flink-agents]
Posted by "wenjin272 (via GitHub)" <gi...@apache.org>.
wenjin272 commented on issue #1013:
URL: https://github.com/apache/flink-agents/issues/1013#issuecomment-5314118154
Thanks for taking this. The proposed naming scheme looks good to me. Assigned.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Feature] Use descriptive thread names for Java and Python async executors [flink-agents]
Posted by "Zhuoxi2000 (via GitHub)" <gi...@apache.org>.
Zhuoxi2000 commented on issue #1013:
URL: https://github.com/apache/flink-agents/issues/1013#issuecomment-5294986865
I'd like to take this one. My plan is to name the async worker threads in both runtimes so they’re easier to identify in thread dumps and profiler output.
For Java, I’ll add a `ThreadFactory` and use names like `flink-agents-async-<n>`, keeping the current daemon behavior and pool sizing unchanged. For Python, I’ll set `thread_name_prefix="flink-agents-async"` on the `ThreadPoolExecutor`.
Happy to use a different naming scheme if you have a preference.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Feature] Use descriptive thread names for Java and Python async executors [flink-agents]
Posted by "wenjin272 (via GitHub)" <gi...@apache.org>.
wenjin272 closed issue #1013: [Feature] Use descriptive thread names for Java and Python async executors
URL: https://github.com/apache/flink-agents/issues/1013
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org