You are understanding is right. The driver is single threaded. So, if it is
busy in a callback it can't send a message to the master.

On Tue, Feb 3, 2015 at 7:04 PM, Chengwei Yang <[email protected]>
wrote:

> On Tue, Feb 03, 2015 at 05:21:55PM -0800, Vinod Kone wrote:
> >
> > On Tue, Feb 3, 2015 at 5:46 AM, Chengwei Yang <
> [email protected]>
> > wrote:
> >
> >     As we can see, mesos-master send offer to chronos at 18:32:33, but
> received
> >     all
> >     4 decline message (LaunchTasksMessage) at 18:33.03, we are very
> curious why
> >     the
> >     first decline doesn't sent before sleep 30 seconds?
> >
> >
> > Just to be sure, if you sleep inside the callback any driver calls you
> make
> > (launch/decline) will not be sent to the master until you return from the
> > callback.
> >
>
> Thanks Vinod, so if I understand correctly you did mean that all calls to
> driver->launchTasks() will to be send at the time it returns from
> resourceOffers() callback?
>
> For example, a pesudo code snippet like blow:
>
> resourceOffers() {
>   foreach offer:offers; do
>     // construct task
>     driver->launchTasks(offer, tasks);
> }
>
> though there isn't any sleep in resourceOffers, but all the tasks only be
> sent
> to mesos-master at the time resourceOffers() finished? rather than sent
> when
> resourceOffers is running as the above code says?
>
> --
> Thanks,
> Chengwei
>

Reply via email to