//Do this blocking operation outside the synch block or our result handler will deadlock
ModelNode compensating = result.getCompensatingOperation() != null ? result.getCompensatingOperation() : new ModelNode();
synchronized (outputStream) {
outputStream.write(ModelControllerClientProtocol.PARAM_OPERATION);
compensating.writeExternal(outputStream);
outputStream.flush();
}
if (completeLatch.getCount() == 0) {
//It was handled synchronously or has completed by now