Skip to content

Add thread-safety warning to README#643

Merged
ewoutkramer merged 2 commits intodevelopfrom
copilot/update-readme-add-warning
Mar 11, 2026
Merged

Add thread-safety warning to README#643
ewoutkramer merged 2 commits intodevelopfrom
copilot/update-readme-add-warning

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 10, 2026

Validator and its resolvers (including internal caches) are not thread-safe. Multi-threaded validation requires separate instances per thread — sharing a single instance leads to unpredictable behavior.

Description

  • Added a prominent ⚠️ Thread-safety warning blockquote to the Getting Started section of README.md
  • Warning covers: Validator, associated resolvers, and their internal caches
  • Advises creating a separate Validator + resolver instance per thread for concurrent usage

Related issues

Testing

Documentation-only change; no tests required.

Original prompt

This section details on the original issue you should resolve

<issue_title>Should we make the validator instance thread-safe?</issue_title>
<issue_description>This discussion https://chat.fhir.org/#narrow/stream/179171-dotnet/topic/Encountered.20an.20error.20while.20loading.20schema surfaces the issue that most of our code is not thread safe. It does not have to be, and in fact most classes in Microsoft's stack aren't either, but in this case it does mean that to safely do multi-threaded validation, one needs to create multiple instances of the validator and the resolvers, which will mean multiple instances of caches.

This is an inconvenience that we might want to fix in a future (major?) release of the validator.

</issue_description>

<agent_instructions>Please implement a warning in the README as suggested</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: alexzautke <548617+alexzautke@users.noreply.github.com>
Copilot AI changed the title [WIP] Add warning about thread safety in validator Add thread-safety warning to README Mar 10, 2026
@alexzautke alexzautke marked this pull request as ready for review March 11, 2026 00:36
@alexzautke alexzautke requested a review from ewoutkramer March 11, 2026 00:37
@ewoutkramer ewoutkramer merged commit 0b42bad into develop Mar 11, 2026
2 checks passed
@ewoutkramer ewoutkramer deleted the copilot/update-readme-add-warning branch March 11, 2026 13:14
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.

Should we make the validator instance thread-safe?

3 participants