Nuitka+fastapi+uvicorn=«multiprocessing/resource_tracker.py:96: UserWarning: resource_tracker: process died unexpectedly, relaunching»
See original GitHub issueConsider following minimal sample project used FastAPI with uvicorn, based on pipenv for fast reproduceability. https://github.com/belonesox/fastapi-unicorn-nuitka-troubles
-
Checkout it.
-
test1.py
demo service with 1 worker -
test2.py
demo run service with 2 workers -
sh reproduce-me.sh
— compile both of them -
pure_python_ok.sh
— successfully run using raw python (both 1worker and 2worker versions).
INFO: Uvicorn running on http://0.0.0.0:8040 (Press CTRL+C to quit)
INFO: Started parent process [1138946]
INFO: Started server process [1138961]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Started server process [1138962]
INFO: Waiting for application startup.
INFO: Application startup complete.
To check that service is working, just open http://localhost:8040/docs
compiled_1worker_ok.sh
— run compiled nuitka version with 1 worker, OKINFO: Started server process [1139332] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:8040 (Press CTRL+C to quit)
compiled_2worker_bad.sh
— run compiled nuitka version with 2 worker, failed withtest2.dist/multiprocessing/resource_tracker.py:96: UserWarning: resource_tracker: process died unexpectedly, relaunching. Some resources might leak.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Python resource_tracker: process died unexpectedly when ...
Python resource_tracker: process died unexpectedly when using multiprocessing 'spawn' method in clear environment - Stack Overflow. Stack ...
Read more >Strange behavior of Python multiprocessing package - GitLab
... UserWarning: resource_tracker: process died unexpectedly, relaunching. Some resources might leak. warnings.warn('resource_tracker: ...
Read more >Process died unexpectedly returned from clustered engine ...
This technote outlines a possible problem with configuring clustered IBM® Rational® Build Forge® Engines, and details how it can be resolved.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Confirm that. Works for me on
even with 100 workers.
This just worked for me with 2 workers. Probably a multiprocessing improvement fixed that some time ago.