Add context to MysqlDaemon schema functions#6243
Merged
systay merged 1 commit intovitessio:masterfrom Jun 1, 2020
Merged
Conversation
fcfae7c to
ec4d39d
Compare
deepthi
approved these changes
May 29, 2020
Collaborator
deepthi
left a comment
There was a problem hiding this comment.
LGTM. Nice work! I'll let others take a look before we merge.
enisoc
reviewed
May 29, 2020
| func (mysqld *Mysqld) GetColumns(dbName, table string) ([]*querypb.Field, []string, error) { | ||
| conn, err := getPoolReconnect(context.TODO(), mysqld.dbaPool) | ||
| func (mysqld *Mysqld) GetColumns(ctx context.Context, dbName, table string) ([]*querypb.Field, []string, error) { | ||
| conn, err := getPoolReconnect(ctx, mysqld.dbaPool) |
Member
There was a problem hiding this comment.
Note that this only applies the Context to fetching the connection. If you want the actual query to respect Context, you can replace conn.ExecuteFetch() everywhere with mysqld.executeFetchContext().
Contributor
Author
There was a problem hiding this comment.
hmm...who should be doing that exactly?
Member
There was a problem hiding this comment.
Any method of Mysqld that wants to respect Context should use mysqld.executeFetchContext() as a wrapper around conn.ExecuteFetch() instead of calling it directly.
Contributor
Author
|
FYI, converted PR to draft, to address @enisoc's comments. |
Signed-off-by: Toliver Jue <toliver@planetscale.com>
Contributor
Author
|
@enisoc PTAL |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Needed to correctly cancel long-running queries where rpc's may disconnect.
Signed-off-by: Toliver Jue toliver@planetscale.com