Browse Source

MINOR: Fixed some resource leaks. (#8922)

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
pull/9044/head
Leonard Ge 4 years ago committed by GitHub
parent
commit
cd6850b410
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      clients/src/main/java/org/apache/kafka/clients/producer/MockProducer.java
  2. 1
      clients/src/test/java/org/apache/kafka/common/memory/GarbageCollectedMemoryPoolTest.java
  3. 1
      clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java
  4. 1
      clients/src/test/java/org/apache/kafka/common/security/oauthbearer/internals/expiring/ExpiringCredentialRefreshingLoginTest.java

2
clients/src/main/java/org/apache/kafka/clients/producer/MockProducer.java

@ -69,7 +69,7 @@ public class MockProducer<K, V> implements Producer<K, V> { @@ -69,7 +69,7 @@ public class MockProducer<K, V> implements Producer<K, V> {
private boolean producerFenced;
private boolean sentOffsets;
private long commitCount = 0L;
private Map<MetricName, Metric> mockMetrics;
private final Map<MetricName, Metric> mockMetrics;
public RuntimeException initTransactionException = null;
public RuntimeException beginTransactionException = null;

1
clients/src/test/java/org/apache/kafka/common/memory/GarbageCollectedMemoryPoolTest.java

@ -80,6 +80,7 @@ public class GarbageCollectedMemoryPoolTest { @@ -80,6 +80,7 @@ public class GarbageCollectedMemoryPoolTest {
GarbageCollectedMemoryPool pool = new GarbageCollectedMemoryPool(1000, 10, true, null);
ByteBuffer fellOffATruck = ByteBuffer.allocate(1);
pool.release(fellOffATruck);
pool.close();
}
@Test

1
clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java

@ -903,6 +903,7 @@ public class SslTransportLayerTest { @@ -903,6 +903,7 @@ public class SslTransportLayerTest {
NetworkTestUtils.waitForChannelClose(selector, node, ChannelState.State.AUTHENTICATION_FAILED);
server.close();
selector.close();
serverChannelBuilder.close();
}
}

1
clients/src/test/java/org/apache/kafka/common/security/oauthbearer/internals/expiring/ExpiringCredentialRefreshingLoginTest.java

@ -368,6 +368,7 @@ public class ExpiringCredentialRefreshingLoginTest { @@ -368,6 +368,7 @@ public class ExpiringCredentialRefreshingLoginTest {
inOrder.verify(mockLoginContext).login();
}
}
testExpiringCredentialRefreshingLogin.close();
}
}
}

Loading…
Cancel
Save