Skip to content

fix: tear down area detector live view on close - #175

Open
Osayi-ANL wants to merge 5 commits into
mainfrom
fix/area-det-close-while-live
Open

Osayi-ANL wants to merge 5 commits into
mainfrom
fix/area-det-close-while-live

Conversation

@Osayi-ANL

@Osayi-ANL Osayi-ANL commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Stops the area detector’s live timers and PVA/CA monitors cleanly when the window closes, preventing callbacks from outliving the viewer.

Test plan:

  • Open Area Detector.
  • Start a live stream.
  • Close Area Detector while the stream is live.
  • Confirm no error appears in the terminal.

@Osayi-ANL
Osayi-ANL force-pushed the fix/area-det-close-while-live branch from ac49dfe to 3e93269 Compare September 23, 2026 16:54

@pecomyint pecomyint left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please own and stop/join the PV-poller thread before clearing monitors, and run reader cleanup unconditionally. A close-during-poller test still registered an HKL monitor after close and triggered the EPICS thread teardown error.

@Osayi-ANL
Osayi-ANL force-pushed the fix/area-det-close-while-live branch from 3e93269 to 8384221 Compare September 29, 2026 19:32
@pecomyint

pecomyint commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Please update this branch after #172 lands: both PRs modify BaseWindow.closeEvent, and the resolved method must retain #172's save_layout() plus this PR's begin_close()/stop_child_timers() behavior

@Osayi-ANL

Copy link
Copy Markdown
Collaborator Author

Rebased onto main after #172. BaseWindow.closeEvent now runs save_layout(), then begin_close() and stop_child_timers().

Review points:

  • The PV poller thread is owned (_pv_poller_thread) and joined with no timeout before any monitor is cleared; the sweep also checks is_closing between steps.
  • Reader cleanup (ROI backup monitor + stop_channel_monitor()) runs unconditionally, each step guarded separately.
  • Covered by test_teardown_waits_for_the_poller_before_clearing_monitors, test_poller_join_has_no_timeout and test_teardown_cleans_the_reader_even_when_the_pva_monitor_is_idle.

@Osayi-ANL
Osayi-ANL force-pushed the fix/area-det-close-while-live branch from 8384221 to 66f7181 Compare October 9, 2026 16:41
@Osayi-ANL
Osayi-ANL requested a review from pecomyint October 9, 2026 16:41
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