src: replace duplicate loop hook regs#444
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughRefactors blocked-loop hook management to replace existing hooks with matching callbacks instead of duplicating, adds a helper to recompute the minimum blocked threshold, provides a thread-safe Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/agents/test-grpc-blocked-loop.mjs (1)
158-158: Minor: Add semicolon for consistency.The debug log is fine for test visibility, but the missing semicolon is inconsistent with the rest of the file.
Suggested fix
- console.log(times) + console.log(times);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/agents/test-grpc-blocked-loop.mjs` at line 158, Add the missing semicolon to the debug statement: update the console.log(times) call in test-grpc-blocked-loop.mjs (the console.log invocation used for test visibility) to end with a semicolon to match the file's style and maintain consistency.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@test/agents/test-grpc-blocked-loop.mjs`:
- Line 158: Add the missing semicolon to the debug statement: update the
console.log(times) call in test-grpc-blocked-loop.mjs (the console.log
invocation used for test visibility) to end with a semicolon to match the file's
style and maintain consistency.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 79c04b91-0e47-4b5f-99d9-07e3df3a9261
📒 Files selected for processing (4)
src/nsolid/nsolid_api.ccsrc/nsolid/nsolid_api.hsrc/nsolid/thread_safe.htest/agents/test-grpc-blocked-loop.mjs
cc47380 to
b99a8a2
Compare
Replace blocked and unblocked loop hook entries when the same callback is registered again. These hooks were stored in append-only TSList containers, so dynamic reconfiguration in agents like gRPC and ZMQ kept stale registrations alive. That caused duplicate callback delivery and let old blocked loop thresholds continue affecting detection. Add TSList::replace_if() and use it in blocked and unblocked loop hook registration. When the callback function pointer matches an existing entry, overwrite it instead of appending a new one. For blocked loop hooks, recompute min_blocked_threshold_ after each registration so a replaced threshold immediately becomes effective. PR-URL: #444 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: EHortua <55801532+EHortua@users.noreply.github.com>
b99a8a2 to
20e6cad
Compare
Replace blocked and unblocked loop hook entries when the same callback is registered again.
These hooks were stored in append-only TSList containers, so dynamic reconfiguration in agents like gRPC and ZMQ kept stale registrations alive. That caused duplicate callback delivery and let old blocked loop thresholds continue affecting detection.
Add TSList::replace_if() and use it in blocked and unblocked loop hook registration. When the callback function pointer matches an existing entry, overwrite it instead of appending a new one.
For blocked loop hooks, recompute min_blocked_threshold_ after each registration so a replaced threshold immediately becomes effective.
Summary by CodeRabbit
Bug Fixes
Tests