Enhancement: Adds Code to Enable Exception Handling Using CosmosClientOptions#5072
Closed
kundadebdatta wants to merge 1 commit intoananth/openai-exception-handling-asynccachefrom
Conversation
dibahlfi
reviewed
Mar 19, 2025
| CosmosClientTelemetryOptions cosmosClientTelemetryOptions = null, | ||
| IChaosInterceptorFactory chaosInterceptorFactory = null) | ||
| IChaosInterceptorFactory chaosInterceptorFactory = null, | ||
| bool? enableStackTraceOptimization = false) |
Member
There was a problem hiding this comment.
do we need both ? and a default value of false?
dibahlfi
reviewed
Mar 19, 2025
| public async Task ValidateNegativeScenario(bool forceRefresh) | ||
| { | ||
| AsyncCacheNonBlocking<string, string> asyncCache = new AsyncCacheNonBlocking<string, string>(); | ||
| AsyncCacheNonBlocking<string, string> asyncCache = new AsyncCacheNonBlocking<string, string>(enableStackTraceOptimization: false); |
Member
There was a problem hiding this comment.
even if we don't set the enableStackTraceOptimization: false, the constructor has a default value? but I think being explicit is always good.
| /// When enabled, critical SDK components optimize exception handling to minimize performance overhead. | ||
| /// The default value is 'false'. | ||
| /// </summary> | ||
| internal bool? EnableStackTraceOptimization { get; set; } |
Member
There was a problem hiding this comment.
Do we need ternary state for decision model?
Member
There was a problem hiding this comment.
Two states with default being true is my preference
| /// <summary> | ||
| /// To enable stack trace optimization to reduce stack trace proliferation in high-concurrency scenarios where exceptions are frequently thrown. | ||
| /// When enabled, critical SDK components optimize exception handling to minimize performance overhead. | ||
| /// </summary> |
Member
There was a problem hiding this comment.
Builder change is not needed.
| internal InternalCache( | ||
| bool enableStackTraceOptimization) | ||
| { | ||
| this.collectionInfoByName = new AsyncCache<string, ContainerProperties>(new CollectionRidComparer()); |
| /// When enabled, critical SDK components optimize exception handling to minimize performance overhead. | ||
| /// The default value is 'false'. | ||
| /// </summary> | ||
| internal bool? EnableStackTraceOptimization { get; set; } |
Member
There was a problem hiding this comment.
Suggested change
| internal bool? EnableStackTraceOptimization { get; set; } | |
| internal bool? EnableAsyncCacheExceptionSharing { get; set; } |
Member
Author
|
This PR is duplicate of #5073 . Hence closing this to track the mainline. |
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.
Pull Request Template
Description
This PR enables
AsyncCacheandAsyncCacheNonBlockingException Handling UsingCosmosClientOptions.Type of change
Please delete options that are not relevant.
Closing issues
To automatically close an issue: closes #IssueNumber