- public <T> void executeRead(final AbstractRead<T> readCmd, final SettableFuture<T> returnFuture) {
- if(LOG.isDebugEnabled()) {
- LOG.debug("Tx {} executeRead {} called path = {}", getIdentifier(), readCmd.getClass().getSimpleName(),
- readCmd.getPath());
+ public <T> void executeRead(final AbstractRead<T> readCmd, final SettableFuture<T> returnFuture,
+ final Boolean havePermit) {
+ LOG.debug("Tx {} executeRead {} called path = {}", getIdentifier(), readCmd.getClass().getSimpleName(),
+ readCmd.getPath());
+
+ final Throwable failure = failedModification;
+ if (failure != null) {
+ // If we know there was a previous modification failure, we must not send a read request, as it risks
+ // returning incorrect data. We check this before acquiring an operation simply because we want the app
+ // to complete this transaction as soon as possible.
+ returnFuture.setException(new ReadFailedException("Previous modification failed, cannot "
+ + readCmd.getClass().getSimpleName() + " for path " + readCmd.getPath(), failure));
+ return;