-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
audit background contexts #14869
audit background contexts #14869
Conversation
I see you updated files related to
|
AER Report: CI Core ran successfully ✅AER Report: Operator UI CI ran successfully ✅ |
8601834
to
d1a62bc
Compare
cf797c9
to
9e12028
Compare
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.
LGTM
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.
Mercury stuff looks good
@@ -74,11 +74,10 @@ func (c *client) DoRequest(ctx context.Context, streamsLookup *mercury.StreamsLo | |||
c.multiFeedsRequest(ctx, ch, streamsLookup) | |||
}) | |||
|
|||
// TODO (AUTO 9090): Understand and fix the use of context.Background() here | |||
reqTimeoutCtx, cancel := context.WithTimeout(context.Background(), mercury.RequestTimeout) |
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 had actually seen strange issues when we were creating a new context from existing context with timeout instead of context.background where we saw the timeout was not being respected. https://smartcontract-it.atlassian.net/browse/AUTO-9090 has more details
if we want to fix this ideally we should also test the behaviour to ensure it is working correctly. I am not sure what's the impact of letting this code be as is, is there a possibility to have an exception for use of background context here and not change this?
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 don't understand the issue described in the ticket. If the claim is that something continues to run longer than the given timeout, that is not necessarily a bug, and leaving out the parent context here will have no effect.
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.
Also, the timeout is not being applied to the actual request, only below when waiting for the response. That seems incorrect. Should this be moved up before the threadCtrl.GoCtx call?
https://smartcontract-it.atlassian.net/browse/BCF-3204
Requires