This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients RahulARanger, mark.dickinson
Date 2021-11-09.17:51:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1636480274.93.0.526879487517.issue45689@roundup.psfhosted.org>
In-reply-to
Content
Sorry Rahul: I'm not the right person to help you push this forward.

I'm sympathetic to the problem: I've encountered similar issues in "Real Code", where we needed to associate log outputs generated by worker pool threads with the actual tasks that generated those logs. But I'm not convinced either that setting the thread name is the right mechanism to get that association (it doesn't extend nicely to other executor types, for example), or that the API you propose is the right one (I find the duplication between `submit` and `submit_with_name` to be a bit much).

I'm wondering whether there's some way that executors could use contextvars to provide a per-task context. Then a task "name" could potentially be part of that context, and possibly you could write a custom log handler that read the name from the context when emitting log messages.

If you want to find someone to help push this forward, it may be worth posting on the python-ideas mailing list to get discussion going.
History
Date User Action Args
2021-11-09 17:51:14mark.dickinsonsetrecipients: + mark.dickinson, RahulARanger
2021-11-09 17:51:14mark.dickinsonsetmessageid: <1636480274.93.0.526879487517.issue45689@roundup.psfhosted.org>
2021-11-09 17:51:14mark.dickinsonlinkissue45689 messages
2021-11-09 17:51:14mark.dickinsoncreate