{"record":{"id":"9d9de6789a9de170","repo":"apache/pulsar","slug":"timeout-during-managed-ledger-terminate","errorCode":null,"errorMessage":"Timeout during managed ledger terminate","messagePattern":"Timeout during managed ledger terminate","errorType":"exception","errorClass":"ManagedLedgerException","httpStatus":null,"severity":"error","filePath":"managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java","lineNumber":1596,"sourceCode":"        final Result result = new Result();\n\n        asyncTerminate(new TerminateCallback() {\n            @Override\n            public void terminateComplete(Position lastPosition, Object ctx) {\n                result.lastPosition = lastPosition;\n                counter.countDown();\n            }\n\n            @Override\n            public void terminateFailed(ManagedLedgerException exception, Object ctx) {\n                result.exception = exception;\n                counter.countDown();\n            }\n\n        }, null);\n\n        if (!counter.await(AsyncOperationTimeoutSeconds, TimeUnit.SECONDS)) {\n            throw new ManagedLedgerException(\"Timeout during managed ledger terminate\");\n        }\n\n        if (result.exception != null) {\n            log.error().exception(result.exception).log(\"Error terminating managed ledger\");\n            throw result.exception;\n        }\n\n        return result.lastPosition;\n    }\n\n    @Override\n    public boolean isTerminated() {\n        return state == State.Terminated;\n    }\n\n    @Override\n    public boolean isMigrated() {\n        return migrated;","sourceCodeStart":1578,"sourceCodeEnd":1614,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java#L1578-L1614","documentation":"S3_VALIDATION is applied to the S3 family of drivers and requires managedLedgerOffloadServiceEndpoint to be set explicitly; it throws this IllegalArgumentException when getServiceEndpoint() is empty. Unlike the generic validation, the S3-specific check insists on an explicit service endpoint (custom endpoint for S3-compatible stores) before anything else.","triggerScenarios":"Using an S3-driver (driver value validated with S3_VALIDATION) and initializing offload while managedLedgerOffloadServiceEndpoint is null/empty in TieredStorageConfiguration.","commonSituations":"Offloading to MinIO/Ceph/COS/other S3-compatible storage without setting managedLedgerOffloadServiceEndpoint, endpoint URL typo'd or defined under a wrong property name, or config file not reloaded after adding the endpoint.","solutions":["Set managedLedgerOffloadServiceEndpoint=http(s)://<host>:<port> to your S3-compatible endpoint in broker.conf.","Then also supply managedLedgerOffloadBucket (the next check) and managedLedgerOffloadRegion if your provider needs it.","Confirm the broker/offloader picks up the property (correct conf file, restarted process, no empty override).","For real AWS S3, prefer a driver variant that doesn't require an explicit endpoint if you don't have a custom one."],"exampleFix":"// before: broker.conf\nmanagedLedgerOffloadDriver=s3\nmanagedLedgerOffloadBucket=minio-bucket\n\n// after: endpoint added\nmanagedLedgerOffloadDriver=s3\nmanagedLedgerOffloadBucket=minio-bucket\nmanagedLedgerOffloadServiceEndpoint=http://minio.internal:9000","handlingStrategy":"validation","validationCode":"if (config.getServiceEndpoint() == null || config.getServiceEndpoint().isEmpty()) {\n    throw new IllegalStateException(\"managedLedgerOffloadServiceEndpoint must be set for driver \" + config.getDriver());\n}\nnew java.net.URI(config.getServiceEndpoint()); // must be a valid endpoint URI","typeGuard":null,"tryCatchPattern":"try {\n    provider.validate(tieringConfig);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"ServiceEndpoint must specified\")) {\n        log.error(\"Set managedLedgerOffloadServiceEndpoint=http(s)://host:port for S3-compatible offload\");\n    }\n    throw e;\n}","preventionTips":["Always set managedLedgerOffloadServiceEndpoint when targeting MinIO/Ceph/COS or any custom S3 endpoint.","Include scheme (http:// or https://) and port in the endpoint URL.","Validate the endpoint is reachable from the broker network zone before enabling offload.","Keep endpoint and bucket properties in the same config revision to avoid partial configs."],"tags":["configuration","validation","s3","endpoint"],"backgroundTag":"missing-config-property","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"}