Skip to content
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

implement additional context specific sql interfaces #921

Closed
wants to merge 2 commits into from

Conversation

kylejbrock
Copy link
Contributor

No description provided.

@maddyblue
Copy link
Collaborator

This failed with:

=== RUN   TestContextCancelBegin
    TestContextCancelBegin: go18_test.go:212: unexpected error: pq: current transaction is aborted, commands ignored until end of transaction block
--- FAIL: TestContextCancelBegin (0.02s)

Looks like this has bugs.

}

func (st *stmt) watchCancel(ctx context.Context) func() {
if done := ctx.Done(); done != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Spidey sense says this is problematic. Way too many go routines and chan listens to make me feel safe here.

@kylejbrock
Copy link
Contributor Author

kylejbrock commented Dec 10, 2019 via email

@maddyblue
Copy link
Collaborator

You may need to stress it locally. Could be a race condition.

@autarch
Copy link

autarch commented Jan 16, 2020

Oops, ignore that PR I linked against this one. I meant to link to a different one.

@jalan
Copy link

jalan commented Jan 17, 2020

=== RUN   TestContextCancelBegin
    TestContextCancelBegin: go18_test.go:212: unexpected error: pq: current transaction is aborted, commands ignored until end of transaction block
--- FAIL: TestContextCancelBegin (0.02s)

The failure here seems unrelated to this PR. I spent some time trying to reproduce the failure and was unable to do so with either this PR or master. I did find one other failure for this test on Travis, https://travis-ci.org/lib/pq/jobs/355557649, so maybe the test itself has a race.

Spidey sense says this is problematic. Way too many go routines and chan listens to make me feel safe here.

I agree that this code looks scary! But it's the same code as used here https://github.com/lib/pq/blob/master/conn_go18.go#L90

I have been test-driving this PR on a real project in a test environment, and I also wrote a couple of toy servers to check that the context cancellation works as I expect. Everything so far looks good 👍

marselester added a commit to marselester/pq that referenced this pull request Oct 1, 2020
Got rid of OpenConnector for simplicity's sake.

Noticed "pq: current transaction is aborted" in go18_test.go:212,
but it doesn't seem to be related. The same issue popped up in
lib#921.
Copy link

@Lorena-babygirl Lorena-babygirl left a comment

Choose a reason for hiding this comment

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

approving these changes.

Copy link

@Lorena-babygirl Lorena-babygirl left a comment

Choose a reason for hiding this comment

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

submit tour feedback without any explicit approval.

@otan otan closed this in #1047 Sep 2, 2021
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.

5 participants