Skip to content

Conversation

@AlexanderWells-diamond
Copy link
Collaborator

There seems to be no need to load the DBD and DSO early, so doing it just before iocInit allows a programmatic switch to enable/disable it.

Fixes #185

There seems to be no need to load the DBD and DSO early, so doing it
just before iocInit allows a programmatic switch to enable/disable it.
@codecov
Copy link

codecov bot commented Mar 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.30%. Comparing base (e1f104a) to head (026ed69).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #186      +/-   ##
==========================================
+ Coverage   88.18%   88.30%   +0.11%     
==========================================
  Files          15       15              
  Lines        1270     1274       +4     
==========================================
+ Hits         1120     1125       +5     
+ Misses        150      149       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@Araneidae Araneidae left a comment

Choose a reason for hiding this comment

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

Short sweet and to the point, but I suggest improving the error handling.

We don't need the newest version of epicscorelibs.
Fix attempting to use cothread on Windows.
Import registerAllRecordDeviceDrivers ourselves so we can do error
checking the same way as other functions, without relying on
epicscorelibs or needing additional error handling
device.dispatcher = dispatcher

if enable_pva:
dbLoadDatabase('pvxsIoc.dbd', pvxslibs.path.dbd_path, None)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any reason we shouldn't defer all dbd and lib loading until iocInit?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

With this PR there is no longer any lib loading anywhere except in iocInit().

You must load the DBD files before creating records, otherwise epicsdbbuilder / EPICS itself doesn't know what to do with the record entries. So I believe we must do that as early as possible.

For research I tried moving the DBD loading into this function, and it results in a segmentation fault as soon as you try and create a record (presumably EPICS is attempting to call some kind of validation function related to the DBD and doesn't have proper null checks somewhere)

@AlexanderWells-diamond AlexanderWells-diamond merged commit ba24655 into master Mar 28, 2025
43 checks passed
@AlexanderWells-diamond AlexanderWells-diamond deleted the disable_pva branch March 28, 2025 13:03
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.

Starting an IOC without QSRV

4 participants