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.
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
chore: pass context #3326
chore: pass context #3326
Changes from 35 commits
c361d01
03c790b
d161e91
84e4eb6
0ce7485
6d4f044
046182a
0642aaf
b6c4f01
1149333
b094fd6
b13217e
abec13e
b6bcf57
d919b34
2bbc859
f9d9810
8bfc21b
628cc85
26f0200
62edfd1
ff354d1
f85554b
a782f50
1f28648
0d9dfd5
942f2d3
c8cb345
baac073
c7efd9b
2f0e2ad
8792e72
46fe5ce
585235a
1dd32b2
3eaf6ab
221372c
b5031cb
eb26f72
25a24d8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
The context seems to be passed to
backendConfig.WaitForConfig()
only. What if it gets canceled or it times out though? Do we wantGetProviderConfigFromEnv
to return an error?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.
Do we even need a context propagated to this function?
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.
I guess we do, in case of cancelation it would stop waiting for the backend config which is a blocking call, right?
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.
Yeah true but that part of code kinda feels weird to me and probably something which no one would ever use.
Because from the UI he won't even be able to create a S3 destination without filling the required fields but we are waiting for config to get the workspaceID for a destination which isn't there. Not sure if I put it out here properly
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.
@cisse21 I think this is about proper context propagation thus implicitly honouring such contexts. As far as I understand these calls would be part of the gRPC server. So what if the client disconnects during a gRPC request? I would expect the context to get canceled. In such scenarios, with proper ctx propagation, the
backendConfig.WaitForConfig
would correctly return immediately instead of blocking and creating a (temporary) leak:So all considered, I think context propagation does make sense. What I'm not sure of is whether it makes sense to have the function return an error too so that it would properly be logged and handled upstream i.e.:
If yes then
getFileManagerSettings
can return an error as well which can be used byvalidateObjectStorage
which already returns an error that is handled upstream.@achettyiitr any thoughts as well?
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.
@fracasula I am also aligned with passing the context.