Re: [jgroups-users] Strange Behaviour

Questions/problems related to using JGroups <[email protected]>
Newsgroups gmane.comp.java.javagroups.general
Message-ID <[email protected]>
<< What do you mean by "one thread pool"? As long as a thread pool has more 
<< than 1 threads in it, things are asynchronous.

I meant there is thread which handles and processes all proposals which
implements as below (I sent a part of the code before to you, I wish you do
not confuse).

final class StateUpdateHandler implements Runnable {
 private short id;
 public StateUpdateHandler (short id) {
	this.id = id;
 }

/**
 * create a proposal and send it out to all the members
 *
* @param message
*/
@Override
public void run() {
  handleRequests();
}

public void handleRequests() {
   ZabHeader hdrReq = null;
   while (running) {
   try {
   hdrReq = queuedMessages.take();  //queuedMessages contains state change 
  } catch (InterruptedException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
}

long new_zxid = getNewZxid();
MessageOrderInfo messageOrderInfo = hdrReq.getMessageOrderInfo();
messageOrderInfo.setOrdering(new_zxid);
ZabHeader hdrProposal = new ZabHeader(ZabHeader.PROPOSAL, messageOrderInfo);
Message proposalMessage = new Message().putHeader(this.id,hdrProposal);
proposalMessage.setBuffer(new byte[1000]);
proposalMessage.setSrc(local_addr);
Proposal p = new Proposal();
p.setMessageOrderInfo(hdrReq.getMessageOrderInfo());
p.AckCount++;
outstandingProposals.put(new_zxid, p);
queuedProposalMessage.put(new_zxid, hdrProposal);
 try {
      for (Address address : zabMembers) {
          if (address.equals(leader))
             continue;
             Message cpy = proposalMessage.copy();
             cpy.setDest(address);
             down_prot.down(new Event(Event.MSG, cpy));
          }
} catch (Exception ex) {
        log.error("failed proposing message to members");
   } 


I could not understand the following text, I wish you can explain it:

<<......... but means acks for a given proposal can cross COMMITs for the
same proposal, ,,,,,,,,,,,,,



--
View this message in context: http://jgroups.1086181.n5.nabble.com/Strange-Behaviour-tp11141p11148.html
Sent from the JGroups - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.