Skip to content

Commit

Permalink
[fix][broker] AbstractBatchedMetadataStore - use AlreadyClosedExcepti…
Browse files Browse the repository at this point in the history
…on instead of IllegalStateException (apache#19284)

(cherry picked from commit d3e112e)
  • Loading branch information
eolivelli committed Jan 19, 2023
1 parent addb664 commit 6b9967f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.pulsar.metadata.api.GetResult;
import org.apache.pulsar.metadata.api.MetadataStoreConfig;
import org.apache.pulsar.metadata.api.MetadataStoreException;
import org.apache.pulsar.metadata.api.Stat;
import org.apache.pulsar.metadata.api.extended.CreateOption;
import org.apache.pulsar.metadata.impl.AbstractMetadataStore;
Expand Down Expand Up @@ -74,7 +75,8 @@ protected AbstractBatchedMetadataStore(MetadataStoreConfig conf) {
public void close() throws Exception {
if (enabled) {
// Fail all the pending items
Exception ex = new IllegalStateException("Metadata store is getting closed");
MetadataStoreException ex =
new MetadataStoreException.AlreadyClosedException("Metadata store is getting closed");
readOps.drain(op -> op.getFuture().completeExceptionally(ex));
writeOps.drain(op -> op.getFuture().completeExceptionally(ex));

Expand Down

0 comments on commit 6b9967f

Please sign in to comment.