Skip to content

Fix RS485 rewind memory pressure under collision storms#1180

Open
camaro4life18 wants to merge 6 commits intotagyoureit:masterfrom
camaro4life18:fix/rs485-rewind-memory-guard
Open

Fix RS485 rewind memory pressure under collision storms#1180
camaro4life18 wants to merge 6 commits intotagyoureit:masterfrom
camaro4life18:fix/rs485-rewind-memory-guard

Conversation

@camaro4life18
Copy link
Copy Markdown
Contributor

Summary\n- add a hard rewind cap for inbound message rewind loops\n- throttle and truncate rewind collision logging payloads\n- prevent excessive heap churn during sustained RS485 collision/rewind storms\n\n## Root Cause\nThe rewind path could recurse repeatedly while also logging full collision buffers at high frequency, which amplified allocation pressure and contributed to OOM conditions on constrained systems.\n\n## Validation\n- TypeScript build passes\n- runtime stabilization verified on noisy RS485 conditions

…exponential backoff

- Implement requestPumpStatusAsync() to actively poll Hayward pump status instead of no-op
- Add consecutive communication failure tracking with exponential backoff in polling (2s to max 30s after 5 failures)
- Add pollEquipmentAsync() override to include status polling after each state update
- Add updateCommStatus() to set pump status to warning/error based on failure count
- Preserve last known pump state on comm failure instead of zeroing rpm/watts
- Fix silent error swallow in setPumpToRemoteControlAsync (was missing logger.error)
- Increase retries from 1 to 3 and add 2500ms timeout on outbound messages
- Update package-lock.json license identifier to AGPL-3.0-only
- Add singleMixPeriod property to ChemController and ChemDoser classes
- Default is false to maintain backward compatibility
- When enabled, prevents simultaneous chemical dosing during mixing periods
- ChemController: pH checks ORP mixing state and vice versa
- ChemDoser: checks all other dosers for active mixing
- Fixes issue with hot tub chemical balance from simultaneous mixing
@tagyoureit
Copy link
Copy Markdown
Owner

Does this supersede the other #1175? I'd prefer if you break these up into seperate PR's so we can review each individually. There are still some files in here that don't belong (package-lock.json) and constructors being called unnecessarily. And same comments on the rewind approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants