Skip to content

libcephsqlite: ensure atexit handlers are registered after openssl - #68125

Merged
batrick merged 1 commit into
ceph:mainfrom
batrick:i59335
Apr 8, 2026
Merged

batrick merged 1 commit into
ceph:mainfrom
batrick:i59335

Conversation

@batrick

@batrick batrick commented Mar 31, 2026 •

Copy link
Copy Markdown
Member

When disconnecting from RADOS, there may be SimpleRADOSStriper instances attached to it by sqlite3_file (cephsqlite_file) instances. These files must be closed properly so that the SimpleRADOSStriper threads can be joined.

Fixes: https://tracker.ceph.com/issues/59335

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@batrick
batrick requested a review from badone March 31, 2026 11:45
@github-actions github-actions Bot added the libcephsqlite ceph SQLite3 VFS label Mar 31, 2026
@batrick

batrick commented Mar 31, 2026

Copy link
Copy Markdown
Member Author

Need to test this when I get home. Thanks @badone , your analysis helped guide me to the (possible) cause.

@batrick
batrick force-pushed the i59335 branch 2 times, most recently from b7492a1 to 0cd0505 Compare March 31, 2026 12:17
@batrick

batrick commented Mar 31, 2026

Copy link
Copy Markdown
Member Author

I'm no longer confident this is right. I think the issue might be larger with how lcean up is done with librados/monclient but still investigating the root cause.

When the sqlite3 executable encounters an error with .bail=on, it will
make a call to exit(). The atexit() handlers will execute in LIFO order.
We need to ensure that openssl (before OpenSSL 4.0 [1]) atexit handlers are
registered before libcephsqlite.

[1] http://github.com/openssl/openssl/commit/31659fe32673a6bd66abf3f8a7d803e81c6ffeed (OpenSSL 4.0 no longer arms `OPENSSL_cleanup()` function as an `atexit(3)`)

Fixes: https://tracker.ceph.com/issues/59335
Signed-off-by: Patrick Donnelly <[email protected]>
@batrick batrick changed the title libcephsqlite: track open file handles and close on disconnect libcephsqlite: ensure atexit handlers are registered after openssl Apr 7, 2026
@batrick

batrick commented Apr 7, 2026

Copy link
Copy Markdown
Member Author

This PR is under test in https://tracker.ceph.com/issues/75898.

@badone badone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks OK to me Patrick, pending tests of course.

@batrick
batrick marked this pull request as ready for review April 8, 2026 14:09
@batrick
batrick merged commit 43a3e73 into ceph:main Apr 8, 2026
18 of 21 checks passed
@batrick
batrick deleted the i59335 branch April 8, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants