Remove stale siren off-listener handles on retrigger#694
Open
Remove stale siren off-listener handles on retrigger#694
Conversation
09b6537 to
896e40e
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #694 +/- ##
=======================================
Coverage 97.51% 97.51%
=======================================
Files 62 62
Lines 10949 10952 +3
=======================================
+ Hits 10677 10680 +3
Misses 272 272 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
This pull request addresses an issue with the siren entity's timed activation logic, specifically preventing the accumulation of stale canceled handles when the siren is repeatedly turned on with a timer. The changes ensure that canceled listeners are properly removed from the entity's internal tracking, preventing unbounded growth and potential resource leaks. A new test is also added to validate this behavior.
Bug fix: Proper cleanup of stale handles on repeated timed activation
async_turn_onmethod inzha/application/platforms/siren.pyto remove canceled listeners from the_tracked_handlesset, ensuring that only active handles are tracked and preventing memory/resource leaks.Testing improvements
test_siren_repeated_timed_turn_on_leaks_stale_tracked_handlesintests/test_siren.pyto verify that repeated timed activations do not retain stale or canceled handles, and that the cleanup logic works as intended.## SummaryRemoves stale canceled timer handles when re-triggering timed siren activation.
Failing tests addressed
tests/test_siren.py::test_siren_repeated_timed_turn_on_leaks_stale_tracked_handlesVerification
pytest(branch-local targeted run): listed test passes.