spock_apply: bound per-message memory; add 022 regression guard#501
spock_apply: bound per-message memory; add 022 regression guard#501ibrarahmad wants to merge 1 commit into
Conversation
Run the exception-log body in ApplyOperationContext and reset that context once per dispatched message in replication_handler so JSON and tuple allocations no longer accumulate in TopTransactionContext for the outer apply transaction. 022 samples worker RSS via ps during use_try_block and asserts growth is bounded.
📝 WalkthroughWalkthroughThis PR fixes a memory-context leak in the apply worker by scoping exception-handling allocations to ChangesApply Worker Memory Context Leak Fix
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/tap/t/022_apply_mem_context.pl`:
- Line 40: Remove the unused variable $THRESHOLD: delete the declaration "my
$THRESHOLD = $ENV{SPOCK_LEAK_THRESHOLD} // 5_000_000;" and update or remove the
stale comment referencing "5 MB" so the test reflects that the RSS growth limit
is actually controlled by $RSS_GROWTH (the active variable used later in the
test); ensure no remaining references to $THRESHOLD remain and that the comment
accurately describes $RSS_GROWTH's default.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c664da9f-d2cb-49d5-aeb7-ad19af24defc
📒 Files selected for processing (3)
src/spock_apply.ctests/tap/scheduletests/tap/t/022_apply_mem_context.pl
Run the exception-log body in ApplyOperationContext and reset that context once per dispatched message in replication_handler so JSON and tuple allocations no longer accumulate in TopTransactionContext for the outer apply transaction. 022 samples worker RSS via ps during use_try_block and asserts growth is bounded.