Repository navigation
Conversation
- Write a single LIMITS_GROUP_ENABLE_STATE event per group instead of one LIMITS_ENABLE_STATE event per item, and bulk update current_limits_settings - Add a SCOPE__openc3_limits_control stream carrying every event except LIMITS_CHANGE, read by decom so state changes can't trim it - Fix python _limits_group discarding group_name.upper() Closes #3932 Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4112 +/- ##
==========================================
+ Coverage 79.77% 79.80% +0.03%
==========================================
Files 907 907
Lines 69969 70024 +55
Branches 2688 2688
==========================================
+ Hits 55817 55882 +65
+ Misses 13480 13470 -10
Partials 672 672
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude <noreply@anthropic.com>
- Write the limits event and control streams in one MULTI transaction per db_shard so event readers and decom can't diverge - Isolate per-item failures when applying LIMITS_GROUP_ENABLE_STATE so one item error doesn't skip the rest of the group Refs #3932 Co-Authored-By: Claude <noreply@anthropic.com>
|



Closes #3932
Problem
disable_limits_groupon a large group (70k items in the report) had to be run several times before limits actually turned off.Root cause: the decom microservice learns about enable/disable changes from
SCOPE__openc3_limits_events, which is capped at ~1000 entries (maxlen 1000)._limits_groupwrote oneLIMITS_ENABLE_STATEevent per item, and decom also writes aLIMITS_CHANGEevent for every item state change into the same stream. When decom falls behind processing telemetry, events are trimmed before it reads them.current_limits_settingsin Redis was always correct, but decom only reads that at startup, so a restart was the only reliable workaround.Changes (Ruby and Python)
enable_limits_group/disable_limits_groupwrite a singleLIMITS_GROUP_ENABLE_STATEevent listing the items by target and packet, instead of one event per item.current_limits_settingsis updated with one bulk read/write, each packet is read and written once, and items are matched with a hash instead of a nested scan. The call goes from ~45s to ~1.5s for 70k items.LimitsEventTopic.writealso sends every event exceptLIMITS_CHANGEto a new low-volumeSCOPE__openc3_limits_controlstream. The decom microservice andsync_system_thread_bodyread only that stream, so a flood of limits state changes can't trim control events (settings, enable state, limits set, state colors) before decom reads them.SCOPE__openc3_limits_eventsstill gets every event, so Limits Monitor andget_limits_eventsare unchanged.process_eventapplies the group event only to targets, packets and items in that decom's System._limits_groupnow uses the result ofgroup_name.upper()(previously discarded, so lowercase group names failed).Behavior change: the group call now logs one
Enabling/Disabling Limits Group: NAMEmessage instead of one log line and one event message per item.Testing
LIMITS_CHANGE, and a flood test (group disable followed by 1500LIMITS_CHANGEevents) that fails when the reader uses the old shared stream.spec/api,spec/topics,spec/microservicesand the Pythontest/api,test/topics,test/microservicessuites pass.decom_microservice_spec.rb:58fails when run together with the limits specs, but it fails the same way onmain.mainEach cycle also confirmed
enable_limits_grouptook effect starting from disabled.Not addressed
A decom microservice that is still starting up can miss control events written before its first read of the stream. That was already true before this change; it should be a separate issue.
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Tests