[V4] Add thread safety note to service clients docs#4402
Merged
dscpinheiro merged 2 commits intodevelopmentfrom May 4, 2026
Merged
[V4] Add thread safety note to service clients docs#4402dscpinheiro merged 2 commits intodevelopmentfrom
dscpinheiro merged 2 commits intodevelopmentfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the service client generator so all generated V4 service client classes include an XML documentation note stating that client instances are thread-safe and recommending reuse.
Changes:
- Added a thread-safety/reuse
<para>block to the generated service client class summary documentation. - Regenerated the T4 preprocessed output for
BaseGeneratorto include the new doc block. - Added a DevConfig entry describing the change for release/changelog processing.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| generator/ServiceClientGeneratorLib/Generators/BaseGenerator.tt | Adds the new thread-safety/reuse note to the generated service client XML docs. |
| generator/ServiceClientGeneratorLib/Generators/BaseGenerator.cs | Updated preprocessed T4 output to reflect the template change (also includes environment/version/path churn). |
| generator/.DevConfigs/6e10e7e5-61f3-4259-937f-340f2f9c93b3.json | DevConfig metadata to capture the change in release notes. |
peterrsongg
approved these changes
May 4, 2026
muhammad-othman
approved these changes
May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #2098
Motivation and Context
Adds a note to all generated service clients about thread safety, and also a recommendation to create a single instance and re-use it for the application's lifetime.
Message will be displayed below
Implementation for accessing ...and before the service documentation.Before:

After:

Dry-runs
DRY_RUN-bbfbe4df-8583-4af9-9a63-86f47e14998cDRY_RUN-7a9d6e52-d701-46db-a73e-37d555bb4198Breaking Changes Assessment
N/A
License