Repository navigation
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the synchronization-batching change.
No open issues 🎉
What changed in this PR
Fixes oversized plugin synchronization requests by safely splitting runtime state into smaller messages, addressing the slice-bound panics and retry failures described in #356 and #364.
Changes:
- Uses one object limit and derives safe pod and container slice bounds from the remaining state.
- Ensures oversized retries shrink, supports batches below eight objects, and stops when a single object cannot fit.
- Adds transport-level and builtin-plugin regression tests for uneven snapshots, small batches, and states that never fit.
| File | Description |
|---|---|
pkg/adaptation/plugin.go |
Reworks synchronization batching and oversized-message retry limits. |
pkg/adaptation/adaptation_suite_test.go |
Adds regression tests for safe splitting, retry progress, and terminal failure. |
Review effort: Balanced
76fde90 to
cc615ad
Compare
|
there's a typo in the commit header.. panadaWall vs pandaWall |
|
A follow-up is needed to document the split-message protocol. A plugin author would not know that a plugin may receive several Synchronize messages, or that it must reply with More set to match the request and return no updates until the last message. Maybe document it for the more field in api.proto. |
Thank you very much for the detailed review. My ID is pandaWall。 |
Fix handling oversized Synchronize messages to - not attempt to access outside of slice bounds and panic - always reduce the number of objects sent after an oversized message - split a state of fewer than eight objects instead of giving up - never send an empty message unless we have no pods and containers - give up if we can't send a single object Move the synchronization tests to adaptation_suite_test.go, with cases for a state which never fits a message and one which splits down to a single object per message. Co-developed-by: chenchen <424509874@qq.com> Co-developed-by: pandaWall <mangosteen922@126.com> Assisted-by: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
cc615ad to
1fedccc
Compare
@mikebrow There is no protocol change introduced here, and the mechanism is hidden from plugin authors. The stub collects split messages, combines them to a single one and delivers it to the plugin as a single event. This just fixes a potential panic and a few other problems in the existing message splitting logic. |
Sorry. Fixed it in this PR. But did you notice that in your tree all your signoffs use panadaWall, not pandaWall. That is where this mistake came from. Also in your other repo/tree. For instance $ git log -1 172a0c016138b1dcd058660140b59e46db7cf2a0 | grep Wall
Author: panadaWall <mangosteen922@126.com>
Signed-off-by: panadaWall <mangosteen922@126.com> |
Thank you for the fix and for thoroughly investigating the issue in the codebase rather than just patching that single line of code. And yes — that extra a was 100% mine, not a rebase artifact. |
This PR combines ideas and test cases from #356 and #364, reworks the tests to live in the adaptation_test package, adds a few necessary extra fixes, and test cases. Credits go largely to @alex-chenc and @pandaWall and they are marked as co-authors.
In particular this PR fixes handling oversized Synchronize messages to
Move the synchronization tests to adaptation_suite_test.go, with cases for a state which never fits a message and one which splits down to a single object per message.