{"record":{"id":"ef26be5bae513497","repo":"apache/pulsar","slug":"restexception-e-ef26be","errorCode":null,"errorMessage":"RestException(e)","messagePattern":"RestException\\(e\\)","errorType":"exception","errorClass":"RestException","httpStatus":500,"severity":"error","filePath":"pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/NonPersistentTopics.java","lineNumber":707,"sourceCode":"                            .attr(\"isGlobal\", isGlobal)\n                            .log(\"Successfully remove entry filters\");\n                    asyncResponse.resume(Response.noContent().build());\n                })\n                .exceptionally(ex -> {\n                    handleTopicPolicyException(\"removeEntryFilters\", ex, asyncResponse);\n                    return null;\n                });\n    }\n\n    private Topic getTopicReference(TopicName topicName) {\n        try {\n            return pulsar().getBrokerService().getTopicIfExists(topicName.toString())\n                    .get(config().getMetadataStoreOperationTimeoutSeconds(), TimeUnit.SECONDS)\n                    .orElseThrow(() -> new RestException(Status.NOT_FOUND, \"Topic not found\"));\n        } catch (ExecutionException e) {\n            throw new RestException(e.getCause());\n        } catch (InterruptedException | TimeoutException e) {\n            throw new RestException(e);\n        }\n    }\n}\n","sourceCodeStart":689,"sourceCodeEnd":711,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/NonPersistentTopics.java#L689-L711","documentation":"Same wrapping point as the ExecutionException path: if the getTopicIfExists future times out (exceeds config().getMetadataStoreOperationTimeoutSeconds()) or the waiting thread is interrupted, the broker throws RestException(e). Typically surfaces as HTTP 500 (server-side timeout) when topic lookup cannot complete in time.","triggerScenarios":"Calling an admin endpoint that calls getTopicReference while the metadata store is slow or overloaded; request takes longer than metadataStoreOperationTimeoutSeconds; thread interrupted during shutdown.","commonSituations":"Loaded brokers, slow/degraded metadata store, broker shutdown or restarts interrupting in-flight admin requests.","solutions":["Increase broker metadataStoreOperationTimeoutSeconds if the store is legitimately slow","Check metadata store latency/health (ZooKeeper session issues, etcd slowness)","Retry the request; investigate broker logs for store timeouts"],"exampleFix":"// broker.conf\n// before: metadataStoreOperationTimeoutSeconds=30\n// after: metadataStoreOperationTimeoutSeconds=60","handlingStrategy":"retry","validationCode":"// pre-check broker/store responsiveness before issuing admin calls\nadmin.brokerStats().getTopics(); // cheap health probe","typeGuard":null,"tryCatchPattern":"try { t = admin.topics().stats(topic); } catch (PulsarAdminException e) { if (isTimeout(e)) retryWithBackoff(); }","preventionTips":["Raise metadataStoreOperationTimeoutSeconds under heavy load","Watch ZooKeeper/etcd latency metrics","Avoid admin calls during broker shutdown"],"tags":["timeout","metadata-store","rest-api"],"backgroundTag":"metadata-store-timeout","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}