[zeromq-dev] Is there a bug in mdbroker.c?

Pieter Hintjens ph at imatix.com
Sat Sep 7 08:59:30 CEST 2013


You're right. When we get a heartbeat from a worker we should also
move it to the head of the list. I think the code should call
   s_worker_waiting (worker); instead of directly resetting the expiry
time. I don't have time to test that change right now -- would you
like to?

-Pieter

On Sat, Sep 7, 2013 at 8:44 AM, 雷达 <leida.njucs at gmail.com> wrote:
> Excuse me,I read the  book and have a question.I'm not sure if there
> is a bug in  mdbroker.c?
> In method s_broker_purge,it assumes that the worker in waiting list is
> ordered by expiry.But when broker received hearbeat msg from worker,
> it only updates worker's expiry. Maybe It breaks the order of waiting
> list.
> For example,the broker receives reday msg from worker A and B,then it
> appends A,B to wating list.After a while B breaks down, and A sends
> heartbeat msg to broker. When broker receives A's heartbeat msg,it
> updates A's expiry. Now A's expiry is more recently than B.
> Is that a bug? Or I have made a mistake.  Thank you very much.
> --
> Department of Computer Science & Technology, Nanjing University
> address:306, MengMinwei Building, Hankou Road  22, Nanjing University
> Nanjing 210093, P.R.China
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev



More information about the zeromq-dev mailing list