Open paultiq opened 2 weeks ago
Confirmed on the main branch, but this isn't related to InterpreterPoolExecutor
. ipe_executor._thread_name_prefix
does appear to be set to the correct value, and the Thread
object name is the right value when checking it directly with ipe_executor._threads
.
The problem is that thread names aren't pushed down to subinterpreters, which very well might be a wontfix depending on the complexity of the change. Here's a reproducer for that:
import _interpreters
import threading
source = """
import threading
print(threading.current_thread().name) # Dummy-1
"""
def main():
interp = _interpreters.create()
print(threading.current_thread().name) # Hello
_interpreters.run_string(interp, source)
threading.Thread(target=main, name="hello").start()
cc @ericsnowcurrently, it might be better to just note this when subinterpreters get documented better. (Though, if that's the case, thread_name_prefix
should just get removed from InterpreterPoolExecutor
.)
Bug report
Bug description:
InterpreterPoolExecutor takes a thread_name_prefix parameter, but it doesn't propagate to the underlying subinterpreter.
Produces
CPython versions tested on:
CPython main branch
Operating systems tested on:
Windows