Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leaked Semaphore Objects #4131

Open
rodja opened this issue Dec 21, 2024 Discussed in #4129 · 0 comments · May be fixed by #4132
Open

Leaked Semaphore Objects #4131

rodja opened this issue Dec 21, 2024 Discussed in #4129 · 0 comments · May be fixed by #4132
Labels
bug Something isn't working
Milestone

Comments

@rodja
Copy link
Member

rodja commented Dec 21, 2024

Discussed in #4129

Originally posted by ChipsAHoai December 20, 2024

Question

I am having leaked semaphore issues when running nicegui with fastapi. Initially, I thought it was my code, however, I just tested this on Zauberzeug's repo running the start.sh bash script under examples/fastapi and immediately closed down the uvicorn server and it still shows leaked semaphores. Is there a solution for this?

Reproduction:

cd examples/fastapi
./start.sh dev
Starting Uvicorn server in development mode...
INFO:     Will watch for changes in these directories: ['nicegui/examples/fastapi']
INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO:     Started reloader process [54107] using WatchFiles
INFO:     Started server process [54109]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
^CINFO:     Shutting down
INFO:     Waiting for application shutdown.
INFO:     Application shutdown complete.
INFO:     Finished server process [54109]
INFO:     Stopping reloader process [54107]
/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 6 leaked semaphore objects to clean up at shutdown

^CINFO: Shutting down is the line where I press CTRL-C to abort the execution.

It also happens when starting native mode and reloading:

from nicegui import ui

ui.label("hello")

ui.run(native=True)

Pressing CTRL-C yields also a leaked semaphore objects warning.

@rodja rodja added the bug Something isn't working label Dec 21, 2024
@rodja rodja added this to the 2.10 milestone Dec 21, 2024
@rodja rodja linked a pull request Dec 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant