[3.4.x-3.11.0-beta] Watchlog causing freeze in Reload Domain
anatawa12
This is the same as the following Canny post, recreated since it's old: https://feedback.vrchat.com/sdk-bug-reports/p/udonsharp-watchlog-causing-extreme-long-reloading-domain-time-and-editor-stutter
The watchlog feature in UdonSharp integrated to VRCSDK adds CleanupLogWatcher to beforeAssemblyReload in editor update event (every frame) without checking duplicates while
AppData/LocalLow/VRChat/VRChat
does not exist.As a result, CleanupLogWatcher is called millions of times on domain reload.
This freezes domain reload for hours, which prevents updating udon scripts and SDKs without forcibly stopping Unity Editor.
There is one pull request intended to fix this issue. it has one downside: it stops polling VRChat directory existence. This would reduce editor loop lag, but it might be an unintended side effects.
Another possible fix for this freeze without disabling polling is inserting
AssemblyReloadEvents.beforeAssemblyReload -= CleanupLog
just before +=
.This is a known idiom for idempotent event subscription.
Log In