Replies: 1 comment
-
|
During the ContextVar follow-up work for #880 (building on #878's locking), the defensive coding audit flagged a few pre-existing style items in
None of these are functional bugs — the module works correctly. Just bringing them to the same standard as the rest of the gradio UI layer. Happy to submit a cleanup PR if there's interest, or these can be picked up whenever someone's already touching the file. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I missed an inconsistency in GPU sync ordering in PR #869 — I fixed
_clear_accelerator_cache()but didn't scan the file for the same pattern inunload(). While investigating why I missed it and checking for similar gaps, I ran a broader audit and found a few additional areas that may warrant attention. Flagging them here for visibility — happy to submit PRs for any of these if helpful.GPU synchronization gaps
init_service_memory_basic.py:38-42empty_cache()without precedingsynchronize()init_service_loader.py:127-140del self.model,synchronize()is in a separate try-except afterempty_cache()— if it fails, cleanup is incompleteinit_service_orchestrator.py:191-200Nonewithout callingunload()— GPU memory from partially loaded models may not be freedThread safety
i18n/i18n.py:138-155— addressed in #878get_i18n()checks_i18n_instancewithout a lock before initializationapi/api_routes.py:22-86— addressed in #878_api_keyglobal modified byset_api_key()without synchronization while async handlers read itapi/api_routes.py:94, 153-164— addressed in #878diskcache.Cacheaccessed from concurrent async handlers without lockinglocal_cache.py:28-40Singleton— addressed in #878__new__has a double-checked lock pattern where_initializedcan be staleMinor / low priority
release_task_audio_paths.py:64-84if— addressed in #879os.close(fd)fails on temp file, file descriptor leaksapi_routes.py:90-98— addressed in #879diskcache.Cachecreated at module load but never closed on shutdownruntime_helpers.py:62-73Tested on Windows 11, Python 3.11, RTX 5090. Findings are from code review, not observed failures — flagging proactively.
Beta Was this translation helpful? Give feedback.
All reactions