Skip to content

Destructible drivers#39

Open
exzombie wants to merge 3 commits intoareaDetector:masterfrom
exzombie:destructible-drivers
Open

Destructible drivers#39
exzombie wants to merge 3 commits intoareaDetector:masterfrom
exzombie:destructible-drivers

Conversation

@exzombie
Copy link

@exzombie exzombie commented Feb 25, 2026

This builds on top of areaDetector/ADCore#572 (see that PR for for more details on what this is about) and areaDetector/ADGenICam#49. The driver had an existing epicsAtExit hook, but the new approach properly disables the asyn port, preventing EPICS scan threads and other external actors from accessing the driver when the IOC starts shutting down.

@daykin
Copy link
Contributor

daykin commented Feb 25, 2026

@exzombie and I are in agreement (based on a fake camera) that b73fb18 correctly tells the camera to release the Channel Control Privilege flag. I will verify on a real camera, but it should be good to merge.

@exzombie exzombie marked this pull request as ready for review February 26, 2026 09:05
Without stopping the thread, the IOC hangs on shutdown because the
destructor of the thread objects waits for the thread to exit. This was
not a problem before because the destructors never ran.
Without this, even if the camera object is destroyed, control of the
camera is never properly relinquished. With some cameras, this means
that it is not possible to reconnect to the camera until the previous
connection times out.

Deletion of stream and camera is moved from the destructor into the
shutdown function so that it happens even on old asyn that doesn't
destroy the driver.
@exzombie exzombie force-pushed the destructible-drivers branch from b73fb18 to c79b8c3 Compare February 26, 2026 16:10
@exzombie
Copy link
Author

Reworded commits as per areaDetector/ADCore#572 (comment)

@exzombie
Copy link
Author

I will verify on a real camera, but it should be good to merge.

I've tested this now with a camera that is susceptible to an unclean shutdown. With the current master, the control privilege is not immediately available after IOC restart. With this branch, everything is ok.

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