-
Notifications
You must be signed in to change notification settings - Fork 3.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
Limit context background #8093
Limit context background #8093
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8093 +/- ##
==========================================
- Coverage 61.50% 61.49% -0.02%
==========================================
Files 651 651
Lines 37253 37266 +13
==========================================
+ Hits 22912 22916 +4
- Misses 11932 11945 +13
+ Partials 2409 2405 -4
|
643df57
to
6ce5013
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.
Good start. However this PR doesn't fully close the issue. There are more places where we need to update the code to reduce context.Background
use in non test files (eg in /types
, /x/...
)
Yeah, you are right. I have pushed the update. |
81930bd
to
8f439f1
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.
utACK
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Let's resolve conflicts and finish the review. Let me know if you can finish this PR. |
Let's reopen. @cyberbono3 -when are you planning to finish 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.
There are still few not resolved comments.
1876128
to
aa4c41d
Compare
9d187e3
to
03c9368
Compare
@robert-zaremba all checks pass. Please take a look. |
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.
looks good. thanks.
@@ -8,12 +8,12 @@ import ( | |||
"github.com/cosmos/cosmos-sdk/client" | |||
) | |||
|
|||
func getBlock(clientCtx client.Context, height *int64) (*ctypes.ResultBlock, error) { | |||
func getBlock(ctx context.Context, clientCtx client.Context, height *int64) (*ctypes.ResultBlock, 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.
in fact we are working on making client.Context
implementing context.Context
. But it's on hold now.
Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: sahith-narahari <sahithnarahari@gmail.com>
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.
thanks, utACK. I'm a bit suspicous why client/docs/statik/statik.go
was modified, @cyberbono3 can you explain?
If the user specifies an incorrect `--home`, then the old behaviour would automatically populate it with fresh values, but we should fail instead.
@@ -62,7 +62,7 @@ func runMigrateCmd(cmd *cobra.Command, args []string) error { | |||
|
|||
var ( | |||
tmpDir string | |||
migrator keyring.InfoImporter | |||
migrator keyring.Importer |
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'm not sure why github is showing diff of another PR...
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've seen it already in the past.
I can respond on that. It inherits a context from command, rather than creating a new one. |
would prefer statik.go to be always generated, and never manually modified. |
Ah, I didn't check the file is generated - good point. .... so we woould need to change the statik? |
I have replaced modified statik.go with original statik.go from cosmos/master |
Description
Found few cases for limiting context.Background()
Folllowing @robert-zaremba proposal:
-we can access context from function arguments or
-we can access context from parent function context
closes: #7834
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes