Will time-consuming RPC block the heartbeat and so cause timeout in JGroups?

115 views Asked by At

I'm using TCP protocol in my jgroups program and set FD_ALL.timeout to 12000ms FD_ALL.interval=4000ms. sending code like

MessageDispatcher.sendMessage(message, new RequestOptions(ResponseMode.GET_ALL, 4000))

RequestHandler code like this:

public Object handle(Message message) {
     //time consuming code
    }

sometimes it cost more then 12000ms to handle the message. my question is when that happend will it block the heartbeat packet until timeout? and so cause a viewAccepted event indicate the left of that peer?

2

There are 2 answers

0
BlackJoker On

I think this will only block the sending thread and the next sending thread(if exists a netxt send)

0
user207421 On

If your expected service time is N your timeout should be 2N, as a rule of thumb.