Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

[Backport to 0.34] Configuration do not cache sender instance #686

Merged
merged 1 commit into from
Feb 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions jaeger-core/src/main/java/io/jaegertracing/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -579,11 +579,6 @@ public SenderConfiguration getSenderConfiguration() {
*/
@Getter
public static class SenderConfiguration {
/**
* A custom sender set by our consumers. If set, nothing else has effect. Optional.
*/
private Sender sender;

/**
* The Agent Host. Has no effect if the sender is set. Optional.
*/
Expand Down Expand Up @@ -648,15 +643,11 @@ public SenderConfiguration withAuthPassword(String password) {
}

/**
* Returns a sender if one was given when creating the configuration, or attempts to create a sender based on the
* configuration's state.
* Returns a sender based on the configuration's state.
* @return the sender passed via the constructor or a properly configured sender
*/
public Sender getSender() {
if (sender == null) {
sender = SenderResolver.resolve(this);
}
return sender;
return SenderResolver.resolve(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,11 @@ public void testOverrideServiceName() {
@Test
public void testDefaultTracer() {
Configuration configuration = new Configuration("name");
assertNotNull(configuration.getTracer());
assertNotNull(configuration.getTracer());
JaegerTracer tracer = configuration.getTracer();
assertNotNull(tracer);
configuration.closeTracer();
tracer = configuration.getTracer();
assertNotNull(tracer);
configuration.closeTracer();
}

Expand Down