Skip to content

Fix IOC reliability issues - #6

Open
Anthony Sligar (sligara7) wants to merge 6 commits into
NSLS2:mainfrom
sligara7:fix_ioc_deploy
Open

Anthony Sligar (sligara7) wants to merge 6 commits into
NSLS2:mainfrom
sligara7:fix_ioc_deploy

Conversation

@sligara7

Copy link
Copy Markdown
  • Fix typo: status_socket_socket -> status_socket in open_experiment_status
  • Fix undefined variable: return legend, path in get_legends_data
  • Fix case-sensitive legend matching: use h.lower() for mass header filtering
  • Add socket reconnection with retry logic on broken pipe instead of silent death
  • Make MASsoft host/port configurable via --mas-host and --mas-port CLI args
  • Wrap all blocking socket calls in run_in_executor to prevent event loop starvation
  • Replace fixed 4096-byte recv with chunked read loop for large responses
  • Remove redundant FileHandler logging (procServ handles log capture)
  • Remove unused imports (os, closing, PureWindowsPath, EXPERIMENT_DIRECTORY, MOST_RECENT_FILE)

- Fix typo: status_socket_socket -> status_socket in open_experiment_status
- Fix undefined variable: return legend, path in get_legends_data
- Fix case-sensitive legend matching: use h.lower() for mass header filtering
- Add socket reconnection with retry logic on broken pipe instead of silent death
- Make MASsoft host/port configurable via --mas-host and --mas-port CLI args
- Wrap all blocking socket calls in run_in_executor to prevent event loop starvation
- Replace fixed 4096-byte recv with chunked read loop for large responses
- Remove redundant FileHandler logging (procServ handles log capture)
- Remove unused imports (os, closing, PureWindowsPath, EXPERIMENT_DIRECTORY, MOST_RECENT_FILE)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add from __future__ import annotations
- Sort imports per isort conventions
- Replace f-strings in logging with lazy % formatting
- Assign exception messages to variables before raising (EM101/EM102)
- Remove leftover debug print statements
- Rename unused args with _ prefix (instance -> _instance, new_file_name -> _new_file_name)
- Replace try/except/pass with contextlib.suppress
- Remove unnecessary else after break (RET508)
- Use unpacking instead of list concatenation (RUF005)
- Remove unnecessary intermediate variables before return (RET504)
- Replace ambiguous en dash with hyphen in comments (RUF003)
- Apply ruff formatter for consistent style

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

Merge behavior from working .txt versions into the .py package structure:
- Restore socket timeout=5→20 for network deployment, remove FileHandler
- Use .txt's single -xFilename call, error checking, and logging style
- Keep .py improvements: chunked recv, reconnect logic, per-socket open methods
- Fix swapped close/abort error messages, simplify abort/close putters
- Add open_experiment alias for IPython workflow compatibility
- Restore TEMPLATE_DICT, separate MID/Mass PV loops, experiment default

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Combines the protocol-correct CRLF framing, hot-link threads, and diagnostic
PVs from the rewrite with the working version's reliability patterns (eager
connect, polling fallback, reconnect retry, module-level constants).

Key changes:
- massoft_client.py: merged _CRLFSocket with compat send_command/receive,
  flexible constructor (cfg, host/port, or config file), compat aliases
  (initialize, shutdown, run_experiment, etc.), socket property aliases,
  fixed bug where __init__ used cfg before self.cfg was set
- cap2.py: working PV names (RunExp/AbortExp/CloseExp), rewrite diagnostic
  PVs (Connected/Status/LastError/DataAge/StatusAge), hot-link acquire with
  polling fallback, dual arg parsing for --mas-host/--mas-port + caproto args
- Added hiden_config.json for runtime configuration
- Added ARG002 ruff suppression for caproto putter signatures
- Deleted cap2.txt and massoft_client.txt (superseded by merged .py files)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds the rewrite-style PVs alongside the existing working-version PVs:
- Go: uses GoOD/GoOT/GoFilename config PVs, calls x_go()
- Abort: calls safe_abort_and_wait(), updates Status PV
- Close: safe abort->wait->close sequence, stops acquire/links

The working-version PVs (RunExp, AbortExp, CloseExp) are retained for
backward compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

2 participants