Hi Ben, On Fri, Mar 20, 2015 at 1:13 AM, Ben Wimpory <[email protected]> wrote:
> Hi - I have a question on the akka-distributed-workers example on > activator. > > Is someone able to explain how multiple masters in the cluster are > prevented from submitting different work items to the same worker ? The > master's 'workers' map is private to each Master, so isn't there a constant > race condition between masters to assign work to the shared set of workers > ? > > eg. > > 1. Given 2 masters M1,M2 and 2 workers W1/W2, with masters both loaded > with plenty of work on their queues. > 2. M1 and M2 signal work to do to workers > 3. W1 and W2 request work items > 4. M1 and M2 consider both workers to be idle in their separate private > workerState map so send a job from queue to each idle worker. > 5. Result is W1 and W2 are sent two Work messages each, with each worker > dropping the second piece of work due to move into Working FSM state. > 6. Assuming jobs take a while to execute, the ignored jobs timeout on the > master and are requeued. > > That can happen, but it is assumed that it is harmless since the jobs timeout and are retried. It can probably be improved by sending back a WorkRejected(workId) from the worker when it receives Work in its working state. Regards, Patrik > > Any help appreciated on this. > > Thanks, > > Ben > > > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: > http://doc.akka.io/docs/akka/current/additional/faq.html > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- Patrik Nordwall Typesafe <http://typesafe.com/> - Reactive apps on the JVM Twitter: @patriknw -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
