Repository navigation
Honor scan_duration_sec when scheduling the discovery scan stop - #1468
Open
brittonbeckham wants to merge 1 commit into
Open
brittonbeckham wants to merge 1 commit into
brittonbeckham wants to merge 1 commit into
Conversation
startDiscoveryScan scheduled the stop with the SCAN_DURATION_SEC constant (10 s), so a configured scan_duration_sec was ignored. Use getScanDuration, which already reads the config and falls back to the same default.
Collaborator
|
Core fix is valid (building on PR #1113): DiscoveryManager.startDiscoveryScan hardcoded SCAN_DURATION_SEC (10s) from the original 2022 Pubber stub; PR #1113 scan_duration_sec = 0 (schema-valid) needs handling: config_discovery_family.json allows 0, which now stops async providers immediately (0ms delay) and, during periodic scans, causes scheduleDiscoveryScan to either tight-loop hundreds of scans within the same second or permanently stall in STOPPED if finished within the same millisecond. |
khyatimahendru
self-requested a review
October 29, 2026 14:09
This branch has not been deployed
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.
Summary
DiscoveryManager.startDiscoveryScanscheduled the scan stop with theSCAN_DURATION_SECconstant (10 s), so a family's configuredscan_duration_secwas ignored.getScanDuration(family)already reads the config and falls back to the same default, but nothing called it.A gateway proxying a large BACnet network needs more than 10 s to read point details; with the hard-coded stop, devices still being read when the window closes are cut off.
Changes
startDiscoveryScancomputes the stop time fromgetScanDuration(family).DiscoveryManagerTest: configured duration (60 s) and unset duration (default 10 s). The 60 s case fails without the fix (expected:<60> but was:<10>).