Skip to content

Conversation

@kinyoklion
Copy link
Member

@kinyoklion kinyoklion commented Nov 10, 2025

SHA256 instances are not thread-safe and under heavy-parallelism will fail.
Newer .Net frameworks have a static method which is higher performance under heavy-parallelism and inherently thread-safe.

This PR introduces a thin abstraction that uses the correct method in a thread-safe way depending on the framework.


Note

Replaces a shared SHA256 instance with a thread-safe LdSha256 utility and updates Big Segments hashing to use it.

  • Internal hashing:
    • Add LdSha256 utility that uses SHA256.HashData on .NET 5+ and per-call ComputeHash on older targets.
    • Update BigSegmentsInternalTypes.BigSegmentContextKeyHash to use LdSha256.HashData instead of a shared SHA256 instance.

Written by Cursor Bugbot for commit d5ab7a0. This will update automatically on new commits. Configure here.

@kinyoklion kinyoklion force-pushed the rlamb/sdk-1569/thread-safe-big-segment-hash branch 2 times, most recently from d2db508 to bdb6fc3 Compare November 10, 2025 17:46
@kinyoklion kinyoklion force-pushed the rlamb/sdk-1569/thread-safe-big-segment-hash branch from bdb6fc3 to d5ab7a0 Compare November 10, 2025 17:53
@kinyoklion kinyoklion marked this pull request as ready for review November 10, 2025 18:08
@kinyoklion kinyoklion requested a review from a team as a code owner November 10, 2025 18:08
@kinyoklion kinyoklion merged commit 06196d8 into main Nov 10, 2025
17 checks passed
@kinyoklion kinyoklion deleted the rlamb/sdk-1569/thread-safe-big-segment-hash branch November 10, 2025 20:55
kinyoklion pushed a commit that referenced this pull request Nov 10, 2025
🤖 I have created a release *beep* *boop*
---


##
[8.10.4](LaunchDarkly.ServerSdk-v8.10.3...LaunchDarkly.ServerSdk-v8.10.4)
(2025-11-10)


### Bug Fixes

* Use thread-safe hash for big segments hashing.
([#180](#180))
([06196d8](06196d8))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Release Server SDK 8.10.4 with a bug fix for thread-safe big segments
hashing and corresponding version bumps.
> 
> - **Server SDK (`pkgs/sdk/server`)**:
> - **Bug fix**: Use thread-safe hash for big segments hashing
(`CHANGELOG.md`).
> - **Version bump**: `8.10.3` → `8.10.4` in
`src/LaunchDarkly.ServerSdk.csproj` and `.release-please-manifest.json`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
1dd1bef. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

3 participants