Skip to content

feat: throttle auto-monitor updates through shared pipeline#982

Merged
wakonig merged 1 commit into
mainfrom
feature/throttle_auto_updates
Jun 26, 2026
Merged

feat: throttle auto-monitor updates through shared pipeline#982
wakonig merged 1 commit into
mainfrom
feature/throttle_auto_updates

Conversation

@wakonig

@wakonig wakonig commented Jun 25, 2026

Copy link
Copy Markdown
Member

Description

This PR moves the auto-monitored updates to a shared pipeline at a throttled update rate. This solves two issues:

  • We deal better with unreasonably high updates rates, e.g. from ECMC
  • The communication to Redis is now more efficient thanks to a shared pipeline.

Additional Comments

If we wanted to, we could further extend it in a follow-up PR to also provide support for the long-awaited "readout priority continous".

Definition of Done

  • Documentation is up-to-date.

@wakonig wakonig force-pushed the feature/throttle_auto_updates branch 3 times, most recently from 577affc to d12e5b9 Compare June 25, 2026 12:41
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.39326% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../bec_server/device_server/devices/devicemanager.py 85.39% 7 Missing and 6 partials ⚠️

📢 Thoughts on this report? Let us know!

@wakonig wakonig force-pushed the feature/throttle_auto_updates branch from 1c0b4d5 to 23a2038 Compare June 25, 2026 14:32
@wakonig wakonig marked this pull request as ready for review June 25, 2026 14:40
Copilot AI review requested due to automatic review settings June 25, 2026 14:40
@wakonig wakonig self-assigned this Jun 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors device auto-monitor signal updates so they are queued and flushed through a shared Redis pipeline at a throttled rate, reducing overhead and coping better with very high update rates (e.g. from ECMC).

Changes:

  • Introduces a dedicated auto-monitor update thread that batches readback/config/limit updates and executes them via one shared Redis pipeline.
  • Changes auto-monitor and limit subscriptions to enqueue updates (instead of publishing immediately) and ensures the update thread is running.
  • Adds/updates unit tests to validate the new queueing, subscription behavior, and update-loop batching.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
bec_server/bec_server/device_server/devices/devicemanager.py Adds throttled, batched auto-monitor update pipeline with a background thread; updates callbacks/subscriptions to enqueue updates.
bec_server/tests/tests_device_server/test_device_manager_ds.py Adds test coverage for new auto-monitor queueing, thread-start behavior, and batched update loop execution.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread bec_server/bec_server/device_server/devices/devicemanager.py
@wakonig wakonig requested a review from a team June 25, 2026 14:55
@wakonig wakonig merged commit aff5e0c into main Jun 26, 2026
40 checks passed
@wakonig wakonig deleted the feature/throttle_auto_updates branch June 26, 2026 07:46
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