-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added grpc interceptor and singleton changes #130
Open
Kaivalya1997
wants to merge
16
commits into
main
Choose a base branch
from
grpc_exit_pods_issue_fix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
80d55ef
added grpc interceptor and singleton changes
Kaivalya1997 5027283
Merge main into grpc_exit_pods_issue_fix
github-actions[bot] 8311749
added moc errors for more granularity
Kaivalya1997 0b6941c
Merge branch 'main' of https://github.com/microsoft/moc-sdk-for-go in…
Kaivalya1997 63cb680
Merge branch 'grpc_exit_pods_issue_fix' of https://github.com/microso…
Kaivalya1997 bac8dc4
Merge main into grpc_exit_pods_issue_fix
github-actions[bot] 7ac5a8e
Merge main into grpc_exit_pods_issue_fix
github-actions[bot] ea0cd61
Merge main into grpc_exit_pods_issue_fix
github-actions[bot] ffbac29
Merge main into grpc_exit_pods_issue_fix
github-actions[bot] 663ebff
Merge main into grpc_exit_pods_issue_fix
github-actions[bot] 9405362
Merge main into grpc_exit_pods_issue_fix
github-actions[bot] da3438d
Merge main into grpc_exit_pods_issue_fix
github-actions[bot] 71821c3
Merge main into grpc_exit_pods_issue_fix
github-actions[bot] d29a50b
Merge main into grpc_exit_pods_issue_fix
github-actions[bot] 16fc14d
Merge main into grpc_exit_pods_issue_fix
github-actions[bot] 3aece37
Merge main into grpc_exit_pods_issue_fix
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this cause an issue if set is called before get. The clientOptsSingleton would be nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if once.Do(f) is called multiple times, only the first call will invoke f, even if f has a different value in each invocation. A new instance of Once is required for each function to execute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the expected behaviour is to call Set before Get, which the developer needs to ensure. In case if Set is not called and Get is invoked first, the default value of the NoExitOnConnFailure will be set to false as once.Do will execute once and set it once finally. In case Get is called before, the value will not be nil. As the NoExitOnConnFailure flag is set at the beginning of the mocctl process, I am ensuring that for mocctl the Set is being called before any Get operations occur
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cant we just check if clientOptsSingleton is not nil and return default if nil?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do that as well, but we would need to take care of thread safety explicitly. I used once.Do because it is inherently thread safe. Do you want me to implement the nil checking logic?