Fix for 3844 : ReplicationDomain.publish can loose changes when called by several thread.
Some locking must be done between the Generation of the ChangeNumber
and the call to broker.publish() because the broker does not do any
re-ordering and the ReplicationServer expect to receive the Changes
in the order defined by the ChangeNumber
| | |
| | | */ |
| | | public void publish(byte[] msg) |
| | | { |
| | | UpdateMsg update = new UpdateMsg(generator.newChangeNumber(), msg); |
| | | UpdateMsg update; |
| | | synchronized (this) |
| | | { |
| | | update = new UpdateMsg(generator.newChangeNumber(), msg); |
| | | |
| | | // If assured replication is configured, this will prepare blocking |
| | | // mechanism. If assured replication is disabled, this returns |
| | | // immediately |
| | | prepareWaitForAckIfAssuredEnabled(update); |
| | | // If assured replication is configured, this will prepare blocking |
| | | // mechanism. If assured replication is disabled, this returns |
| | | // immediately |
| | | prepareWaitForAckIfAssuredEnabled(update); |
| | | |
| | | publish(update); |
| | | publish(update); |
| | | } |
| | | |
| | | try |
| | | { |