Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.2k
gh-133485: Use interpreters.Interpreter in InterpreterPoolExecutor#133957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
gh-133485: Use interpreters.Interpreter in InterpreterPoolExecutor#133957
Uh oh!
There was an error while loading.Please reload this page.
Conversation
5340a57
to62d7c2c
Compareb3c2477
to7697c11
Compare# InterpreterPoolInitializerTest.test_initializer fails | ||
# if we don't have a LOAD_GLOBAL. (It could be any global.) | ||
# We will address this separately. | ||
INITIALIZER_STATUS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@markshannon, any ideas on why this is happening? It smells like a ceval bug, but it certainly could be something I've done wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
ping@markshannon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
There seem to be related changes ininspect.getclosurevars()
since83ba8c2:
before:ClosureVars(nonlocals={},globals={'INITIALIZER_STATUS':'uninitialized'},builtins={},unbound=set())after:ClosureVars(nonlocals={},globals={},builtins={},unbound=set())
init()
on main (without L26):
3RESUME05LOAD_FAST_BORROW0 (x)STORE_GLOBAL0 (INITIALIZER_STATUS)LOAD_CONST0 (None)RETURN_VALUE
- 3.3.5 (2014):
50LOAD_FAST0 (x)3STORE_GLOBAL0 (INITIALIZER_STATUS)6LOAD_CONST0 (None)9RETURN_VALUE
5ea2bb2
to14a8eb9
Compare14a8eb9
toccc135c
Comparebedevere-bot commentedMay 30, 2025
🤖 New build scheduled with the buildbot fleet by@ericsnowcurrently for commitccc135c 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F133957%2Fmerge If you want to schedule another build, you need to add the🔨 test-with-buildbots label again. |
The |
neonene commentedJun 1, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Is the following usage invalid? INITIALIZER_STATUS='uninitialized'definit(x):globalINITIALIZER_STATUSINITIALIZER_STATUS=xINITIALIZER_STATUS# for nowdefget_init_status():returnINITIALIZER_STATUSif__name__=="__main__":fromconcurrent.futuresimportInterpreterPoolExecutorexe=InterpreterPoolExecutor(initializer=init,initargs=('initialized',))fut=exe.submit(get_init_status)assertfut.result()=='initialized'# failsexe.shutdown(wait=True)assertINITIALIZER_STATUS=='uninitialized' |
neonene commentedJun 3, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Line 601 inec12559
I guess the failure case in my previous comment can be resolved if the |
numtasks = 10 | ||
futures = [] | ||
executor = self.executor_type() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
self.executor_type(max_workers=numtasks)
or some better way not to get stuck?
FWIW, I haven't been able to reproduce the failures locally. It certainly is consistent across all the CI workers though. |
dafd5a6
to9a8dcdd
Comparebb8506b
to605c802
Compare32a8752
tocce4c75
CompareWell, I figured out the problem. Apparently However, when a task is submitted, there's a narrow window from the time the task is queued up to when a worker picks up the job. If a second task is submitted and the code reaches The new test ( The solution was to unblock the tasks that did get picked up by workers, so they could finish and the workers could pick up the remaining queued tasks. |
725da50
intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@ericsnowcurrently for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
…tor (pythongh-133957)Most importantly, this resolves the issues with functions and types defined in __main__.It also expands the number of supported objects and simplifies the implementation.(cherry picked from commit725da50)Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
GH-135695 is a backport of this pull request to the3.14 branch. |
…tor (pythongh-133957)Most importantly, this resolves the issues with functions and types defined in __main__.It also expands the number of supported objects and simplifies the implementation.
Uh oh!
There was an error while loading.Please reload this page.
Most importantly, this resolves the issues with functions and types defined in
__main__
.It also expands the number of supported objects.