8000 Kill queries also after the rows start streaming by carlosms · Pull Request #358 · src-d/gitbase-web · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Kill queries also after the rows start streaming #358

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

Merged
merged 1 commit into from
Mar 6, 2019

Conversation

carlosms
Copy link
Contributor
@carlosms carlosms commented Mar 6, 2019

Fix #357.

See issue for details on the bug. This PR basically makes bigger the "wrapper logic" of killing the connection on context cancellation from (QueryContext) to (QueryContext + rows processing).

if err != nil {
return nil, err
}
func queryContext(ctx context.Context, conn *sql.Conn, queryRequest queryRequest) (*serializer.Response, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it really neede to shadow queryRequest type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, I don't follow what you mean here. Can you elaborate?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the name of the parameter is queryRequest and the type of this parameter is queryRequest.
because of it you don't have access to the type anymore inside the function and it is a little bit confusing that queryRequest outside of this function is a type but inside an instance of this type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right, I just copied the code we had before and didn't realize that. Thanks.
I've renamed the var, and because it's a small change I already squashed it to make the branch ready to merge.

Copy link
Contributor
@se7entyse7en se7entyse7en left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

Signed-off-by: Carlos Martín <carlos.martin.sanchez@gmail.com>
@carlosms carlosms merged commit 4cbf198 into src-d:master Mar 6, 2019
@carlosms carlosms deleted the fix-kill branch March 6, 2019 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0