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

HDDS-11574. Ozone client leak in TestS3SDKV1 #7308

Merged
merged 1 commit into from
Oct 14, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ public static HddsProtos.UUID toProtobuf(UUID uuid) {
*/
public static void reportLeak(Class<?> clazz, String stackTrace, Logger log) {
String warning = String.format("%s is not closed properly", clazz.getSimpleName());
if (stackTrace != null && LOG.isDebugEnabled()) {
if (stackTrace != null && log.isDebugEnabled()) {
String debugMessage = String.format("%nStackTrace for unclosed instance: %s",
stackTrace);
warning = warning.concat(debugMessage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,17 +430,18 @@ public void testGetObjectWithoutETag() throws Exception {
byte[] valueBytes = value.getBytes(StandardCharsets.UTF_8);

OzoneConfiguration conf = cluster.getConf();
OzoneClient ozoneClient = OzoneClientFactory.getRpcClient(conf);
ObjectStore store = ozoneClient.getObjectStore();
try (OzoneClient ozoneClient = OzoneClientFactory.getRpcClient(conf)) {
ObjectStore store = ozoneClient.getObjectStore();

OzoneVolume volume = store.getS3Volume();
OzoneBucket bucket = volume.getBucket(bucketName);
OzoneVolume volume = store.getS3Volume();
OzoneBucket bucket = volume.getBucket(bucketName);

try (OzoneOutputStream out = bucket.createKey(keyName,
valueBytes.length,
ReplicationConfig.fromTypeAndFactor(ReplicationType.RATIS, ReplicationFactor.ONE),
Collections.emptyMap())) {
out.write(valueBytes);
try (OzoneOutputStream out = bucket.createKey(keyName,
valueBytes.length,
ReplicationConfig.fromTypeAndFactor(ReplicationType.RATIS, ReplicationFactor.ONE),
Collections.emptyMap())) {
out.write(valueBytes);
}
}

S3Object s3Object = s3Client.getObject(bucketName, keyName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ log4j.logger.org.apache.hadoop.security.ShellBasedUnixGroupsMapping=ERROR
log4j.logger.org.apache.hadoop.util.NativeCodeLoader=ERROR
log4j.logger.org.apache.hadoop.hdds.utils.db.managed=TRACE
log4j.logger.org.apache.hadoop.hdds.utils.db.CodecBuffer=DEBUG
log4j.logger.org.apache.hadoop.ozone.client.OzoneClientFactory=DEBUG