Skip to content

fix(direct_control): honor bare EPICS_CA_* env vars - #120

Merged
Anubhuti Sinha (anubhutisinha04) merged 1 commit into
NSLS2:mainfrom
sligara7:fix/dc-honor-epics-env
Aug 12, 2026
Merged

fix(direct_control): honor bare EPICS_CA_* env vars#120
Anubhuti Sinha (anubhutisinha04) merged 1 commit into
NSLS2:mainfrom
sligara7:fix/dc-honor-epics-env

Conversation

@sligara7

Copy link
Copy Markdown
Collaborator

The PV monitor module set EPICS_CA_AUTO_ADDR_LIST from the service-prefixed DIRECT_CONTROL_EPICS_CA_AUTO_ADDR_LIST with a default of YES, which silently overrode a bare EPICS_CA_AUTO_ADDR_LIST=NO set by the deployment (every pod compose sets the bare form). Broadcast CA discovery therefore stayed on despite the compose comments promising confinement to the explicit address list.

The prefixed variables are now explicit overrides only: when unset, the standard EPICS_CA_* variables — and libca's own defaults (AUTO_ADDR_LIST=YES) — apply untouched, matching how a stock EPICS client behaves.

Adds subprocess-based regression tests covering all four precedence cases (bare honored, prefixed override wins when set, nothing set leaves the env alone). Test-suite conftest is unaffected: it sets the prefixed forms explicitly.

Copilot AI left a comment

Copy link
Copy Markdown

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 fixes EPICS Channel Access environment-variable precedence in the direct-control PV monitoring module so that deployment-provided bare EPICS_CA_* variables are honored unless service-prefixed DIRECT_CONTROL_EPICS_CA_* overrides are explicitly set, matching stock EPICS client behavior.

Changes:

  • Stop defaulting DIRECT_CONTROL_EPICS_CA_AUTO_ADDR_LIST to "YES" in pv_monitor so it no longer silently clobbers a bare EPICS_CA_AUTO_ADDR_LIST=NO.
  • Add subprocess-based regression tests to validate precedence across bare vars, prefixed overrides, and “nothing set” behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
backend/direct_control_service/src/direct_control/monitoring/pv_monitor.py Removes the prefixed auto-address-list default so bare EPICS_CA_* (and libca defaults) are not overridden implicitly.
backend/direct_control_service/tests/test_epics_env_precedence.py Adds regression tests that import pv_monitor in a clean subprocess env to validate precedence rules.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@anubhutisinha04
Anubhuti Sinha (anubhutisinha04) merged commit 689d2d6 into NSLS2:main Aug 12, 2026
9 checks passed
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