apache/pulsar · error · BrokerServiceException.TopicFencedException

Topic is temporarily unavailable

Error message

Topic is temporarily unavailable

What it means

checkTopicFenced reports the topic is fenced/unavailable — it is currently owned by another broker or in a transient state where client operations must retry; producers/consumers are told to back off and reconnect later.

Source

Thrown at pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractTopic.java:1126

    private void updateActiveRateLimiters() {
        List<PublishRateLimiter> updatedRateLimiters = new ArrayList<>();
        updatedRateLimiters.add(this.topicPublishRateLimiter);
        updatedRateLimiters.add(getBrokerPublishRateLimiter());
        if (isResourceGroupRateLimitingEnabled()) {
            updatedRateLimiters.add(resourceGroupPublishLimiter);
        }
        activeRateLimiters = updatedRateLimiters.stream().filter(Objects::nonNull).toList();
    }

    public void updateDispatchRateLimiter() {
    }


    protected void checkTopicFenced() throws BrokerServiceException {
        if (isFenced) {
            log.warn("Attempting to add producer to a fenced topic");
            throw new BrokerServiceException.TopicFencedException("Topic is temporarily unavailable");
        }
    }

    protected CompletableFuture<Void> internalAddProducer(Producer producer) {
        if (isSameAddressProducersExceeded(producer)) {
            log.warn("Attempting to add producer to topic which reached max same address producers limit");
            return CompletableFuture.failedFuture(new BrokerServiceException.ProducerBusyException(
                    "Topic '" + topic + "' reached max same address producers limit"));
        }

        log.debug()
                .attr("producerName", producer.getProducerName())
                .log("Got request to create producer");

        Producer existProducer = producers.putIfAbsent(producer.getProducerName(), producer);
        if (existProducer != null) {
            return tryOverwriteOldProducer(existProducer, producer);
        } else if (!producer.isRemote()) {

View on GitHub (pinned to 820761864e)

Solutions

  1. Retry after re-resolving topic ownership via lookup
  2. Wait for the broker failover/unload to complete
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractTopic.java:1126 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/pulsar@820761864e (2026-09-06). Data as JSON: /api/errors/6a4d52ce681365a3. Report an issue: GitHub.