Skip to content

Problem: infinite hwm of version 4.2 lead to catch no msg  #2228

@laplaceyang

Description

@laplaceyang

In release version of 4.2, we got a change in zmq::pipe_t::set_hwms, that 0 means infinite hwm.

 void zmq::pipe_t::set_hwms (int inhwm_, int outhwm_)
 {
     int in = inhwm_ + inhwmboost;
     int out = outhwm_ + outhwmboost;
 
     // if either send or recv side has hwm <= 0 it means infinite so we should set hwms infinite
     if (inhwm_ <= 0 || inhwmboost <= 0)
         in = 0;
 
     if (outhwm_ <= 0 || outhwmboost <= 0)
         out = 0;
 
     lwm = compute_lwm(in);
     hwm = out;
 }

but in some case ,I use the dealer mode, and set sndhwm after connect, lead to the hwm and lwm eq 0. which is not my origin idea.

Then if one side (dealer mode)(side A) is infinite hwm, and another (router mode)(side B) set hwm to a limit number. Then A side will never send_activate_write to the peer, accoding to the follow code.

    if (lwm > 0 && msgs_read % lwm == 0)
        send_activate_write (peer, msgs_read);

Finally, we got a full hwm by check_hwm, and reset_pollin. Since then, no message can be caught.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions