You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tr...@apache.org on 2018/11/03 09:35:21 UTC
[flink] branch master updated (d20b1ea -> e918488)
This is an automated email from the ASF dual-hosted git repository.
trohrmann pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git.
from d20b1ea [hotfix] Let S3EntropyFsFactoryTest extend from TestLogger
new d3696e5 [FLINK-10757] [tests] Avoid port conflicts in AbstractTaskManagerProcessFailureRecoveryTest
new e918488 [FLINK-10715] Suppress ConcurrnetModificationException in Slf4jReporter
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../java/org/apache/flink/metrics/slf4j/Slf4jReporter.java | 11 +++++++++++
.../AbstractTaskManagerProcessFailureRecoveryTest.java | 2 ++
2 files changed, 13 insertions(+)
[flink] 01/02: [FLINK-10757] [tests] Avoid port conflicts in
AbstractTaskManagerProcessFailureRecoveryTest
Posted by tr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
trohrmann pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit d3696e54d4e2a59268b283db1bbd0085f8ff168a
Author: Tzu-Li Chen <wa...@gmail.com>
AuthorDate: Fri Nov 2 14:13:35 2018 +0800
[FLINK-10757] [tests] Avoid port conflicts in AbstractTaskManagerProcessFailureRecoveryTest
This closes #6998.
---
.../test/recovery/AbstractTaskManagerProcessFailureRecoveryTest.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/flink-tests/src/test/java/org/apache/flink/test/recovery/AbstractTaskManagerProcessFailureRecoveryTest.java b/flink-tests/src/test/java/org/apache/flink/test/recovery/AbstractTaskManagerProcessFailureRecoveryTest.java
index 83298aa..8065d1a 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/recovery/AbstractTaskManagerProcessFailureRecoveryTest.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/recovery/AbstractTaskManagerProcessFailureRecoveryTest.java
@@ -24,6 +24,7 @@ import org.apache.flink.configuration.Configuration;
import org.apache.flink.configuration.HeartbeatManagerOptions;
import org.apache.flink.configuration.HighAvailabilityOptions;
import org.apache.flink.configuration.JobManagerOptions;
+import org.apache.flink.configuration.RestOptions;
import org.apache.flink.configuration.TaskManagerOptions;
import org.apache.flink.runtime.clusterframework.types.ResourceID;
import org.apache.flink.runtime.entrypoint.StandaloneSessionClusterEntrypoint;
@@ -98,6 +99,7 @@ public abstract class AbstractTaskManagerProcessFailureRecoveryTest extends Test
Configuration config = new Configuration();
config.setString(AkkaOptions.ASK_TIMEOUT, "100 s");
config.setString(JobManagerOptions.ADDRESS, "localhost");
+ config.setInteger(RestOptions.PORT, 0);
config.setLong(HeartbeatManagerOptions.HEARTBEAT_INTERVAL, 500L);
config.setLong(HeartbeatManagerOptions.HEARTBEAT_TIMEOUT, 10000L);
config.setString(HighAvailabilityOptions.HA_MODE, "zookeeper");
[flink] 02/02: [FLINK-10715] Suppress
ConcurrnetModificationException in Slf4jReporter
Posted by tr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
trohrmann pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit e91848858cbb760f4429ab306c82232bf9854cb8
Author: Igal Shilman <ig...@data-artisans.com>
AuthorDate: Fri Nov 2 16:40:06 2018 +0100
[FLINK-10715] Suppress ConcurrnetModificationException in Slf4jReporter
This commit suppress the ConcurrentModificationException thrown by the Slf4jReporter
report method. This exception occurs when a metric is added/removed while this report is reporting.
Suppressing this (somewhat expected exception) is needed by our e2e framework to reduce some
false-positive e2e test failures. This does not solves the root issue, which is being tracked in a different issue FLINK-10035.
This closes #7008.
---
.../java/org/apache/flink/metrics/slf4j/Slf4jReporter.java | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/flink-metrics/flink-metrics-slf4j/src/main/java/org/apache/flink/metrics/slf4j/Slf4jReporter.java b/flink-metrics/flink-metrics-slf4j/src/main/java/org/apache/flink/metrics/slf4j/Slf4jReporter.java
index 124efe2..ce6acb0 100644
--- a/flink-metrics/flink-metrics-slf4j/src/main/java/org/apache/flink/metrics/slf4j/Slf4jReporter.java
+++ b/flink-metrics/flink-metrics-slf4j/src/main/java/org/apache/flink/metrics/slf4j/Slf4jReporter.java
@@ -33,6 +33,7 @@ import org.apache.flink.metrics.reporter.Scheduled;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.util.ConcurrentModificationException;
import java.util.Map;
/**
@@ -75,6 +76,16 @@ public class Slf4jReporter extends AbstractReporter implements Scheduled {
@Override
public void report() {
+ try {
+ tryReport();
+ }
+ catch (ConcurrentModificationException ignored) {
+ // at tryReport() we don't synchronize while iterating over the various maps which might cause a
+ // ConcurrentModificationException to be thrown, if concurrently a metric is being added or removed.
+ }
+ }
+
+ private void tryReport() {
// initialize with previous size to avoid repeated resizing of backing array
// pad the size to allow deviations in the final string, for example due to different double value representations
StringBuilder builder = new StringBuilder((int) (previousSize * 1.1));