Stop per-tick log flooding when referenced scenes are absent - #60
Open
lvkz wants to merge 2 commits into
Open
Conversation
Every SceneItem action polls get_scene_item_enabled once per tick. When the active scene collection does not contain the referenced scenes (e.g. a lightweight idle collection while the deck page targets the meeting one), each action logged the warning every second: a page with 58 SceneItem actions wrote ~3,500 journal lines per minute for as long as OBS stayed in that collection. Track already-reported (scene, item) pairs and warn once per pair, naming the pair so the message is actionable.
show_current_filter_status guarded against None, but the backend returns an empty dict when the scene or filter does not exist in the active scene collection. Indexing it raised a KeyError through the rpyc netref, and loguru dumped a ~65-line traceback on every tick -- one full traceback per second per filter action while another collection was active. Fall into the existing UNKNOWN path instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the active scene collection doesn't contain the scenes a deck page references — e.g. switching OBS to a lightweight "idle" collection while the page targets the full one — two per-tick status polls flood the log for as long as that collection stays active:
Cannot find the scene item!unconditionally on every tick. A page with 58 SceneItem actions writes ~3,500 journal lines per minute.get_source_filterreturns an empty dict (notNone) when the scene/filter is missing, so thestatus is Noneguard passes andstatus["filterEnabled"]raises a KeyError through the rpyc netref — loguru then dumps a ~65-line traceback once per second.On the affected machine this produced ~7,500 journal lines/minute, a 1 GB journald and 320 MB of app logs over five days.
Fixes
OBSController.get_scene_item_enabled: track already-reported(scene, item)pairs and warn once per pair, naming the pair so the message is actionable.FilterBase.show_current_filter_status: treat an empty/keyless status as the existing UNKNOWN path instead of indexing it.Testing
Applied to a live installation (StreamController 1.4.11-beta, OBS 32 with the deck page above, OBS parked in the idle collection):
Button behavior is unchanged — both patches touch only the read/status path; press handlers (
set_scene_item_enabled, filter toggles) are untouched, and state display still resolves normally once the right collection is active.