Skip to content

Comments

fix race in global crypto provider installation using OnceLock::set#2986

Closed
vtjl10 wants to merge 3 commits intobluealloy:mainfrom
vtjl10:main
Closed

fix race in global crypto provider installation using OnceLock::set#2986
vtjl10 wants to merge 3 commits intobluealloy:mainfrom
vtjl10:main

Conversation

@vtjl10
Copy link
Contributor

@vtjl10 vtjl10 commented Sep 17, 2025

  • Summary: Replace racy install_crypto logic with atomic OnceLock::set to ensure accurate success reporting under contention.
  • Problem: install_crypto could return true even if another thread initialized CRYPTO first.
  • Solution: Use OnceLock::set(...).is_ok(); add set to the no_std OnceLock wrapper for consistent API.
  • Changes:
    • primitives: add OnceLock::set in no_std wrapper; std path delegates to std::sync::OnceLock::set
    • precompile/interface: rewrite install_crypto to return CRYPTO.set(...).is_ok()

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 17, 2025

CodSpeed Performance Report

Merging #2986 will not alter performance

Comparing vtjl10:main (866b94f) with main (c7e8c29)

Summary

✅ 173 untouched

@rakita
Copy link
Member

rakita commented Sep 19, 2025

Superseded by #2997 thank you for finding it

@rakita rakita closed this Sep 19, 2025
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