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

"Create" does not pass Context properly #685

Closed
martinei opened this issue Jan 17, 2022 · 2 comments · Fixed by #688
Closed

"Create" does not pass Context properly #685

martinei opened this issue Jan 17, 2022 · 2 comments · Fixed by #688

Comments

@martinei
Copy link
Contributor

I use the context Propagation to get (Jaeger-) Traced for the database calls. This works mostly, but Create executes a named statement that produces "dangling" spans due to a missing context. I observered this with postgres and pop 5.3.4 but looking at the code I think the problem still exists and extends to other dialects as well.

The "Exec" here:

_, err = stmt.Exec(model.Value)

should actually be an "ExecContext". Please note, that the preparation of the Named Query already receives the correct Context (via

pop/store.go

Line 48 in e572a4d

func (s contextStore) NamedExec(query string, arg interface{}) (sql.Result, error) {
), but that does not cover the actual execution.

@aeneasr
Copy link
Member

aeneasr commented Jan 31, 2022

If you could supply a PR we can merge that rihgt away :)

@martinei
Copy link
Contributor Author

martinei commented Feb 8, 2022

@aeneasr Could you have a look?

@sio4 sio4 closed this as completed Sep 20, 2022
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 a pull request may close this issue.

3 participants