Index: oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureUtilities.java =================================================================== --- oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureUtilities.java (revision 1863118) +++ oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureUtilities.java (working copy) @@ -35,6 +35,8 @@ import com.microsoft.azure.storage.blob.CloudBlob; import com.microsoft.azure.storage.blob.CloudBlobContainer; import com.microsoft.azure.storage.blob.CloudBlobDirectory; + +import org.apache.jackrabbit.oak.segment.spi.RepositoryNotReachableException; import org.apache.jackrabbit.oak.segment.spi.persistence.Buffer; import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; @@ -80,7 +82,7 @@ blob.download(new ByteBufferOutputStream(buffer)); buffer.flip(); } catch (StorageException e) { - throw new IOException(e); + throw new RepositoryNotReachableException(e); } } Index: oak-segment-tar/pom.xml =================================================================== --- oak-segment-tar/pom.xml (revision 1863118) +++ oak-segment-tar/pom.xml (working copy) @@ -45,6 +45,7 @@ + org.apache.jackrabbit.oak.segment.spi, org.apache.jackrabbit.oak.segment.spi.monitor, org.apache.jackrabbit.oak.segment.spi.persistence Index: oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java =================================================================== --- oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java (revision 1863118) +++ oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java (working copy) @@ -52,6 +52,7 @@ import org.apache.jackrabbit.oak.segment.file.tar.TarFiles; import org.apache.jackrabbit.oak.segment.spi.persistence.RepositoryLock; import org.apache.jackrabbit.oak.segment.spi.persistence.SegmentNodeStorePersistence; +import org.apache.jackrabbit.oak.segment.spi.RepositoryNotReachableException; import org.apache.jackrabbit.oak.segment.spi.persistence.Buffer; import org.apache.jackrabbit.oak.spi.state.NodeBuilder; import org.apache.jackrabbit.oak.stats.CounterStats; @@ -502,6 +503,11 @@ try (ShutDownCloser ignored = shutDown.keepAlive()) { return segmentCache.getSegment(id, () -> readSegmentUncached(tarFiles, id)); } catch (ExecutionException | UncheckedExecutionException e) { + if (e.getCause() instanceof RepositoryNotReachableException) { + log.warn("Unable to access repository", e); + throw asSegmentNotFoundException(e, id); + } + SegmentNotFoundException snfe = asSegmentNotFoundException(e, id); snfeListener.notify(id, snfe); stats.notify(id, snfe); Index: oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/spi/RepositoryNotReachableException.java =================================================================== --- oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/spi/RepositoryNotReachableException.java (nonexistent) +++ oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/spi/RepositoryNotReachableException.java (working copy) @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.jackrabbit.oak.segment.spi; + +import org.apache.jackrabbit.oak.api.IllegalRepositoryStateException; + +/** + * This exception is thrown when the store cannot be accessed (e.g. remote segment store) + */ +public class RepositoryNotReachableException extends IllegalRepositoryStateException { + + public RepositoryNotReachableException(Throwable e) { + super(e); + } + +} Property changes on: oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/spi/RepositoryNotReachableException.java ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property