Hi Avinash, Thanks for the pointer. A quick scan seems to suggest that your implementation requires it to create two different instances of `MasterDetector`, one for master/agent itself, and one for your module. That probably means number of watchers on zookeeper would be doubled? Would that create unnecessary load?
On Tue, Jan 16, 2018 at 11:22 AM, Avinash Sridharan <avin...@mesosphere.io> wrote: > Hi Zhitao, > We actually do this in the `DC/OS` overlay modules we use in DC/OS. The > overlay modules run as Mesos modules both in the Master and the Agent. You > can see how we use the `MasterDetector` in the agent module: > https://github.com/dcos/dcos-mesos-modules/blob/master/ > overlay/agent.cpp#L74 > > https://github.com/dcos/dcos-mesos-modules/blob/master/overlay/ should > have > more details of how the modules are actually used to build DC/OS overlay. > > On Tue, Jan 16, 2018 at 10:20 AM, Zhitao Li <zhitaoli...@gmail.com> wrote: > > > Hi, > > > > Some of our future development work on our custom modules requires them > to > > know the current leader of Mesos master. While it seems like we could > > duplicate the logic in master/slave side to duplicate an instance of > > `MasterDetector`, it seems more natural if we could figure out a clean > way > > to share the existing detector instance in slave to the module. > > > > Any comment on this idea? > > > > Thanks. > > > > -- > > Cheers, > > > > Zhitao Li > > > > > > -- > Avinash Sridharan, Mesosphere > +1 (323) 702 5245 > -- Cheers, Zhitao Li