Skip to content

Commit

Permalink
these plugins should not be loaded at marathon init time (not lazy).
Browse files Browse the repository at this point in the history
Summary:
This solution has been tested to work.   I guess that the debate will be:

  # should this be in the PluginModule or in a AppInfoModule or the like

  # should all the plugins be force loaded... I didn't check but several already are in AuthModule, AkkaHttpModule

Test Plan: yet to come

Reviewers: zen-dog, timcharper, ichernetsky, jeschkies, unterstein, jdef, jenkins

Reviewed By: timcharper, ichernetsky, jenkins

Subscribers: marathon-dev

JIRA Issues: MARATHON-7545

Differential Revision: https://phabricator.mesosphere.com/D995
  • Loading branch information
kensipe committed Aug 17, 2017
1 parent 859a6fb commit 053904f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/main/scala/mesosphere/marathon/core/plugin/PluginModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,25 @@ package core.plugin
import mesosphere.marathon.core.base.CrashStrategy
import mesosphere.marathon.core.plugin.impl.PluginManagerImpl
import mesosphere.marathon.plugin.http.HttpRequestHandler
import mesosphere.marathon.plugin.task.RunSpecTaskProcessor
import mesosphere.marathon.plugin.validation.RunSpecValidator

class PluginModule(config: MarathonConf, crashStrategy: CrashStrategy) {

lazy val pluginManager: PluginManager = PluginManagerImpl(config, crashStrategy)

lazy val httpRequestHandler: Seq[HttpRequestHandler] = pluginManager.plugins[HttpRequestHandler]

/**
* This list of plugins are eagerly loaded at marathon-init time so that configuration failure
* is detected in boot process and Marathon will fail to start.
*
* It is likely long term to have an opt-in strategy for plugins that wish to have this behavior.
*/
private[this] def initPlugins(): Unit = {
pluginManager.plugins[RunSpecTaskProcessor]
pluginManager.plugins[RunSpecValidator]
}

initPlugins()
}

0 comments on commit 053904f

Please sign in to comment.