From fd43e6c181890dbc9e2976d5ddade5b855e8fd4f Mon Sep 17 00:00:00 2001 From: bgrozev Date: Mon, 2 Oct 2023 09:38:14 -0500 Subject: [PATCH] Fix consent checks (#272) * fix: Fix sending consent checks (wrong property name). * log: Log exceptions from PeriodicRunnable. --- src/main/java/org/ice4j/ice/Agent.java | 10 ---------- src/main/java/org/ice4j/util/PeriodicRunnable.java | 11 +++++++++++ src/main/kotlin/org/ice4j/ice/AgentConfig.kt | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/main/java/org/ice4j/ice/Agent.java b/src/main/java/org/ice4j/ice/Agent.java index 19738057..9ceeab23 100644 --- a/src/main/java/org/ice4j/ice/Agent.java +++ b/src/main/java/org/ice4j/ice/Agent.java @@ -21,7 +21,6 @@ import org.ice4j.ice.harvest.*; import org.ice4j.stack.*; import org.ice4j.util.PeriodicRunnable; -import org.jitsi.utils.collections.*; import org.jitsi.utils.concurrent.*; import org.jitsi.utils.logging2.Logger; import org.jitsi.utils.logging2.*; @@ -70,15 +69,6 @@ public class Agent private static final PropertyChangeListener[] NO_STATE_CHANGE_LISTENERS = new PropertyChangeListener[0]; - /** - * The {@link Logger} used by the {@link Agent} class for logging output. - * Note that this shouldn't be used directly by instances of {@link Agent}, - * because it doesn't take into account the per-instance log level. - * Instances should use {@link #logger} instead. - */ - private static final java.util.logging.Logger classLogger - = java.util.logging.Logger.getLogger(Agent.class.getName()); - /** * The name of the {@link PropertyChangeEvent} that we use to deliver * events on changes in the state of ICE processing in this agent. diff --git a/src/main/java/org/ice4j/util/PeriodicRunnable.java b/src/main/java/org/ice4j/util/PeriodicRunnable.java index 73e28fdf..b3c48c18 100644 --- a/src/main/java/org/ice4j/util/PeriodicRunnable.java +++ b/src/main/java/org/ice4j/util/PeriodicRunnable.java @@ -1,5 +1,7 @@ package org.ice4j.util; +import org.jitsi.utils.logging2.*; + import java.time.*; import java.util.concurrent.*; @@ -11,6 +13,11 @@ */ public abstract class PeriodicRunnable { + /** + * The {@link Logger} used by the {@link PeriodicRunnable} class for logging output. + */ + private final static Logger logger = new LoggerImpl(PeriodicRunnable.class.getName()); + /** * A timer to perform periodic scheduling of {@link #run()} execution * on {@link #executor}'s thread. @@ -205,6 +212,10 @@ private void executeRun() { this.run(); } + catch (Exception e) + { + logger.warn("Exception in run(), will retry.", e); + } finally { if (running) diff --git a/src/main/kotlin/org/ice4j/ice/AgentConfig.kt b/src/main/kotlin/org/ice4j/ice/AgentConfig.kt index 5eeb05d2..bb2e835e 100644 --- a/src/main/kotlin/org/ice4j/ice/AgentConfig.kt +++ b/src/main/kotlin/org/ice4j/ice/AgentConfig.kt @@ -28,7 +28,7 @@ class AgentConfig { } val randomizeConsentFreshnessInterval: Boolean by config { - "ice4j.consent-freshness.randomize".from(configSource) + "ice4j.consent-freshness.randomize-interval".from(configSource) } val consentFreshnessOriginalWaitInterval: Duration by config {