-
Notifications
You must be signed in to change notification settings - Fork 34
Resolve context.TODO() and add context argument #154
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
Resolve context.TODO() and add context argument #154
Conversation
b1c0ca7
to
f526dce
Compare
Signed-off-by: Takeshi Arabiki <[email protected]>
Signed-off-by: Takeshi Arabiki <[email protected]>
f526dce
to
e71561e
Compare
Signed-off-by: Takeshi Arabiki <[email protected]>
Signed-off-by: Takeshi Arabiki <[email protected]>
e71561e
to
6cdff2b
Compare
Signed-off-by: Takeshi Arabiki <[email protected]>
Signed-off-by: Takeshi Arabiki <[email protected]>
25566ea
to
609e560
Compare
…tegyI Signed-off-by: Takeshi Arabiki <[email protected]>
Signed-off-by: Takeshi Arabiki <[email protected]>
Signed-off-by: Takeshi Arabiki <[email protected]>
Signed-off-by: Takeshi Arabiki <[email protected]>
Signed-off-by: Takeshi Arabiki <[email protected]>
Signed-off-by: Takeshi Arabiki <[email protected]>
Signed-off-by: Takeshi Arabiki <[email protected]>
Signed-off-by: Takeshi Arabiki <[email protected]>
Signed-off-by: Takeshi Arabiki <[email protected]>
Signed-off-by: Takeshi Arabiki <[email protected]>
Signed-off-by: Takeshi Arabiki <[email protected]>
Signed-off-by: Takeshi Arabiki <[email protected]>
Signed-off-by: Takeshi Arabiki <[email protected]>
609e560
to
526ab84
Compare
Signed-off-by: Takeshi Arabiki <[email protected]>
To avoid the error "Cannot open: File exists" cf. https://github.com/orgs/community/discussions/58174 actions/setup-go v4 or later has its own caching mechanism, so we don't need actions/cache. Signed-off-by: Takeshi Arabiki <[email protected]>
34f76fc
to
0b719e8
Compare
Signed-off-by: Takeshi Arabiki <[email protected]>
c4bc26f
to
1df3281
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.
@abicky LGTM, thank you!
// NOTE: Although cosmos-sdk does not currently use CmdContext in Context.QueryWithData, | ||
// set ctx to clientCtx in case cosmos-sdk uses it in the future. | ||
// (cf. https://github.com/cosmos/cosmos-sdk/blob/v0.50.5/client/query.go#L98, https://github.com/cosmos/cosmos-sdk/blob/v0.50.5/x/auth/types/account_retriever.go#L39, etc.) | ||
clientCtx := c.CLIContext(0).WithCmdContext(ctx) |
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.
good catch!!
~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- |
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.
good catch!
This commit fixes the bug where some iterations skip calling `<-ticker.C` before proceeding to the next loop. This is a regression introduced in hyperledger-labs#154. Signed-off-by: Takeshi Arabiki <[email protected]>
This commit fixes the bug where some iterations skip calling `<-ticker.C` before proceeding to the next loop. This is a regression introduced in hyperledger-labs#154. Signed-off-by: Takeshi Arabiki <[email protected]>
This commit fixes the bug where some iterations skip calling `<-ticker.C` before proceeding to the next loop. This is a regression introduced in hyperledger-labs#154. Signed-off-by: Takeshi Arabiki <[email protected]>
Description
This PR is the third phase and part of the fourth phase of the integration with OpenTelemetry described on #153.
In the first part of the commits, I have added a context argument to the methods called from various code and added
context.TODO()
to each caller. I have also made the downstream methods (the methods called from the method) use the context argument appropriately and added a context argument if necessary.In the second part of the commits, I have replaced
context.TODO()
withcmd.Context()
in the cmd package and made the downstream methods use the context argument appropriately.In the following PRs (the fourth phase), I will do the same thing in other repositories.
Behavior changes
This PR also makes the relayer shutdown gracefully (526ab84) when it receives SIGINT and SIGTERM.
Here is the output from the relayer started by
service start
when I pressed^C
:Before
After
What I have checked
I have confirmed that there is no longer
context.TODO()
as follows:I have also ensured that the CI passes in the following repositories: