Skip to content

Commit

Permalink
Code gardening and fix to existing behavior for JCBC-1175
Browse files Browse the repository at this point in the history
When multiple threads are using queue remove, dont use set the result
value from subdoc fetch for path not found so only one thread succeeds, this
was the existing behavior, full doc to sub doc altered this, so
reverting back to old behavior.

Change-Id: I06340005b30c5c6277fe3e4591b65ddb8cadbbe5
Reviewed-on: http://review.couchbase.org/104351
Tested-by: Subhashni Balakrishnan <[email protected]>
Reviewed-by: Matt Ingenthron <[email protected]>
  • Loading branch information
bsubhashni committed Jan 31, 2019
1 parent c229b2c commit c7274b7
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1963,8 +1963,8 @@ public DocumentFragment<Mutation> call(E element) {
return ResultMappingUtils.convertToSubDocumentResult(ResponseStatus.SUCCESS, mutationOperation, element);
}
});
} else if (throwable instanceof MultiMutationException && throwable.getCause() instanceof PathNotFoundException) {
return Observable.just(ResultMappingUtils.convertToSubDocumentResult(ResponseStatus.SUCCESS, mutationOperation, null));
} else if (throwable.getCause() instanceof PathNotFoundException) {
return Observable.just(ResultMappingUtils.convertToSubDocumentResult(ResponseStatus.NOT_EXISTS, mutationOperation, null));
} else {
return Observable.error(throwable);
}
Expand All @@ -1986,6 +1986,8 @@ public E call(DocumentFragment<Mutation> documentFragment) {
} else {
return (E) val;
}
} else if (status == ResponseStatus.NOT_EXISTS) {
return null;
} else {
throw new CouchbaseException(status.toString());
}
Expand Down

0 comments on commit c7274b7

Please sign in to comment.