Skip to content

Conversation

gavlyukovskiy
Copy link
Contributor

Refactored remoteServiceName resolution logic to be easier to follow
Fixed TraceQueryExecutionListener#getConnection that leaks connection by acquiring (and not closing) additional connection from a DataSource

The main idea is to track current connection and only put it and statements/resultSets it creates into the scope. For most applications there will be only one connection and all resources are closed properly, but if it's not the case we'll not mess up the scope.
The only change that I'm not sure about is that I changed SpanAndScope to have optional Scope, if that's not okay we can always track spans/scopes inside ConnectionInfo/StatementInfo/ResultSetInfo.

I have also removed getters from inner classes, as it seems more in line with other inner classes in Sleuth.

…e multiple connections are used

Refactored remoteServiceName resolution logic to be easier to follow
Fixed TraceQueryExecutionListener#getConnection that leaks connection by acquiring (and not closing) additional connection from a DataSource
@gavlyukovskiy
Copy link
Contributor Author

Looks like that failed KafkaSenderTest.should_inject_native_headers is flaky, it doesn't fail when I run tests locally. Is there a way to rerun he tests?

@marcingrzejszczak
Copy link
Contributor

I've rerun the build

@marcingrzejszczak marcingrzejszczak merged commit f70cee7 into spring-cloud:main Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants