mesos-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Vanns <>
Subject Re: Threading model of mesos API (C++)
Date Wed, 10 Jun 2015 10:15:06 GMT
Thanks for the responses, guys. That link of the 'detailed description'
will be handy - I've not come across that before. I do now have another
question though! Aren't these two a contradiction;

"you launch a task, before the method returns (say you do some blocking
stuff after, like sync update zookeeper), you might get a statusUpdate()
"Methods will not be invoked concurrently, and each method must complete
before the next is called."



On 10 June 2015 at 02:22, Benjamin Mahler <> wrote:

> If that's really what you're seeing, it is a bug and a very surprising
> one, so please provide evidence :)
> See the "detailed description" here:
> The scheduler driver will serially invoke methods on your Scheduler
> implementation. Methods will not be invoked concurrently, and each method
> must complete before the next is called.
> So, we recommend that you don't block inside the callbacks. Otherwise,
> you're blocking the driver as well and your own ability to continue
> processing callbacks.
> On Tue, Jun 9, 2015 at 8:58 AM, James Vanns <> wrote:
>> Hi. I'm toying with the mesos scheduler (C++) API and running into
>> unexpected race conditions. I have *not* synchronised access to attributes
>> of my Scheduler-derived class. Is the mesos library code threaded and
>> network communication asynchronous? What it *looks like* I'm seeing is my
>> statusUpdate() callback being executed before the return of
>> resourceOffers(). Naturally I call driver->launchTasks() inside
>> resourceOffers(). This is intermittent but generally triggered by tasks
>> that report status changes very quickly; eg. a task that fails instantly.
>> Can anyone point me in the right direction of any online API docs that
>> explain how callbacks are invoked? Distributed over a pool of worker
>> threads?
>> Also are the state transitions documented? Eg.
>> mesos::TASK_STAGING -> mesos::TASK_STARTING -> etc.
>> Cheers,
>> Jim
>> --
>> Senior Code Pig
>> Industrial Light & Magic

Senior Code Pig
Industrial Light & Magic

View raw message