Skip to content

Fix: widen MotionLayerState stat counters from uint32 to uint64#1647

Merged
reshke merged 1 commit intoapache:mainfrom
NJrslv:fix-motion-stat-overflow
Mar 30, 2026
Merged

Fix: widen MotionLayerState stat counters from uint32 to uint64#1647
reshke merged 1 commit intoapache:mainfrom
NJrslv:fix-motion-stat-overflow

Conversation

@NJrslv
Copy link
Copy Markdown
Contributor

@NJrslv NJrslv commented Mar 30, 2026

MotionLayerState accumulates stats across all MotionNodeEntry instances.
Per-node entries already use uint64 [0]. The global sum ≥ any individual node,
so it overflows first — at 4GB. Fix by widening to uint64.

Also fix the debug elog() format specifiers to match.

[0]

uint64 stat_total_bytes_sent; /* Bytes sent, including headers. */

MotionLayerState accumulates stats across all MotionNodeEntry instances.
Per-node entries already use uint64. The global sum ≥ any individual
node, so it overflows first — at 4GB. Fix by widening to uint64.

Also fix the debug elog() format specifiers to match.
Copy link
Copy Markdown
Contributor

@my-ship-it my-ship-it left a comment

Choose a reason for hiding this comment

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

The rationale in the commit message is clear and well-referenced. LGTM! 👍

@reshke reshke merged commit 857723b into apache:main Mar 30, 2026
42 checks passed
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