Skip to content

Runtime fixes 3/5: Schedule diagnostics by elapsed time - #433

Merged
guido4096 merged 2 commits into
danielkucera:masterfrom
guido4096:fix/runtime-monitor-schedule
Nov 1, 2026
Merged

guido4096 merged 2 commits into
danielkucera:masterfrom
guido4096:fix/runtime-monitor-schedule

Conversation

@guido4096

@guido4096 guido4096 commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Bus/log notifications woke the system monitor and triggered heap/socket collection before its intended interval. Counting these wakes also accelerated the nominally hourly heap trend. Heap inspection and socket collection ran while the status critical section was held, and uptime_seconds contained milliseconds.

Use monotonic deadlines for health sampling every 30 seconds, summaries every five minutes, and heap-trend samples initially and then hourly. Collect heap and socket data outside the critical section and report uptime in seconds. Delayed runs skip missed intervals rather than replaying them.

Validation

  • 171 host tests passed on this standalone branch (macOS, POSIX enabled, original pinned eBUS revision f730dce).
  • Whitespace checks passed. CI and a fresh firmware build for this isolated branch are pending.
  • For the standalone macOS test run, the two mock-file fixes from part 1/5 were applied as temporary, uncommitted test-only overrides. Those files are not included in this PR.

Schedule regressions cover frequent notifications, repeated deadline checks, delayed execution and long uptimes.

Device check before marking ready

Verify sampling cadence during sustained eBUS traffic and check that uptime advances in seconds. No on-device reduction in CPU use, latency or instability is claimed from the host tests.

Related runtime fixes

Part 3/5 of the single-commit replacements for #430, split at the maintainer's request. Every PR targets master directly and contains only its corresponding change.

Part Scope PR / branch
1/5 Correct host-test mocks #431
2/5 Bound Logs page retention #432
3/5 Schedule diagnostics by elapsed time #433
4/5 Protect string-pool IDs and concurrent access #434
5/5 Buffer HTTP streams and stop after send failures #435

Suggested merge order: the host-test mock fix first, then the other four changes independently. The five patches together reconstruct the exact tracked file tree of #430.

Source commit in #430: 67a5e07.

Throttle heap and socket sampling independently of notification frequency, collect expensive data outside critical sections, and report uptime in seconds. Test sampling and reporting deadlines.
@guido4096
guido4096 force-pushed the fix/runtime-monitor-schedule branch from 06ac261 to 9a332aa Compare October 31, 2026 20:07
@danielkucera

Copy link
Copy Markdown
Owner

@yuhu- , this was your code, I am not sure we need such massive internal diagnostics at all.
Please review.

@@ -0,0 +1,38 @@
// SPDX-License-Identifier: GPL-3.0-or-later

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielkucera license header ?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have objections

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you decided on the GPL-3.0-or-later license? Perhaps we should add the license header to all files in a separate PR.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, GPL3 is fine.
If this is the right format, I can have the PR prepared for the rest of the files.
Please confirm.

@guido4096
guido4096 merged commit 51a06f6 into danielkucera:master Nov 1, 2026
5 checks passed
@yuhu-

yuhu- commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

@yuhu- , this was your code, I am not sure we need such massive internal diagnostics at all.
Please review.

Yes, we need that; it gives us insight into how the memory has evolved, which is helpful in support cases.

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.

3 participants