Merge pull request #82 from rankinc/shutdown-cloudwatch-metrics

Join metrics publishing thread when shutting factory down.
This commit is contained in:
Justin Pfifer 2016-07-21 09:57:57 -07:00 committed by GitHub
commit c936b63808

View file

@ -16,6 +16,7 @@ package com.amazonaws.services.kinesis.metrics.impl;
import java.util.Set;
import com.amazonaws.AbortedException;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.services.cloudwatch.AmazonCloudWatch;
@ -142,6 +143,11 @@ public class CWMetricsFactory implements IMetricsFactory {
public void shutdown() {
runnable.shutdown();
try {
publicationThread.join();
} catch (InterruptedException e) {
throw new AbortedException(e.getMessage(), e);
}
}
}