summaryrefslogtreecommitdiffstats
path: root/container-di
diff options
context:
space:
mode:
authorgjoranv <gv@yahoo-inc.com>2017-05-29 15:34:19 +0200
committergjoranv <gv@yahoo-inc.com>2017-05-29 17:10:57 +0200
commite37daeda6c094d9bffec0d0e0e49e9071d7ed647 (patch)
tree2d8a7f988e1b4a4d3cb4ef53f08c5124e8bb97df /container-di
parent133e0c0984d2ed165e34090125737da76c0b20f7 (diff)
Do not log InterruptedException | ConfigInterruptedException
- Normal during shutdown. - See also that ConfiguredApp.startReconfigurerThread just ignores them. + Cleanup some unused code. + Add a couple TODOs
Diffstat (limited to 'container-di')
-rw-r--r--container-di/src/main/scala/com/yahoo/container/di/Container.scala14
1 files changed, 7 insertions, 7 deletions
diff --git a/container-di/src/main/scala/com/yahoo/container/di/Container.scala b/container-di/src/main/scala/com/yahoo/container/di/Container.scala
index 0bd5b8264d6..cdec5dca04d 100644
--- a/container-di/src/main/scala/com/yahoo/container/di/Container.scala
+++ b/container-di/src/main/scala/com/yahoo/container/di/Container.scala
@@ -6,6 +6,7 @@ import java.util.logging.{Level, Logger}
import com.google.inject.{Guice, Injector}
import com.yahoo.config._
+import com.yahoo.config.subscription.ConfigInterruptedException
import com.yahoo.container.bundle.BundleInstantiationSpecification
import com.yahoo.container.di.ConfigRetriever.{BootstrapConfigs, ComponentsConfigs}
import com.yahoo.container.di.Container._
@@ -62,6 +63,7 @@ class Container(
} catch {
case userException: ComponentConstructorException =>
invalidateGeneration(oldGraph.generation, userException)
+ // TODO: Wrap userException in an Error when generation==0 (+ unit test that Error is thrown)
throw userException
case t: Throwable =>
invalidateGeneration(oldGraph.generation, t)
@@ -92,6 +94,7 @@ class Container(
}
}
+ // TODO: move to ConfiguredApplication
def logAndDie(message: String, cause: Throwable): Unit = {
log.log(Level.SEVERE, message, cause)
try {
@@ -102,13 +105,10 @@ class Container(
Process.logAndDie("Exited for reason (repeated from above):", cause)
}
- val message = newGraphErrorMessage(generation, cause)
- generation match {
- // Disabled, as it breaks application based tests.
- // case 0 => logAndDie(message, cause)
- case _ =>
- log.log(Level.WARNING, message, cause)
- leastGeneration = max(configurer.getComponentsGeneration, configurer.getBootstrapGeneration) + 1
+ leastGeneration = max(configurer.getComponentsGeneration, configurer.getBootstrapGeneration) + 1
+ cause match {
+ case _: InterruptedException | _: ConfigInterruptedException => // Normal during shutdown, do not log anything.
+ case _ => log.log(Level.WARNING, newGraphErrorMessage(generation, cause), cause)
}
}