apache/hadoop · error · IOException
Router quota manager is not initialized.
Error message
Router quota manager is not initialized.
What it means
RouterQuotaUpdateService is the periodic service that keeps the router's in-memory quota cache in sync with the state store. Its constructor fetches router.getQuotaManager() and refuses to start if it is null, because there would be no cache to update. In the standard Router lifecycle the manager is created immediately before this service when dfs.federation.router.quota.enable=true, so seeing this error means that pairing was broken.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterQuotaUpdateService.java:68
public class RouterQuotaUpdateService extends PeriodicService {
private static final Logger LOG =
LoggerFactory.getLogger(RouterQuotaUpdateService.class);
private MountTableStore mountTableStore;
private RouterRpcServer rpcServer;
/** Router using this Service. */
private final Router router;
/** Router Quota manager. */
private RouterQuotaManager quotaManager;
public RouterQuotaUpdateService(final Router router) throws IOException {
super(RouterQuotaUpdateService.class.getName());
this.router = router;
this.rpcServer = router.getRpcServer();
this.quotaManager = router.getQuotaManager();
if (this.quotaManager == null) {
throw new IOException("Router quota manager is not initialized.");
}
}
@Override
protected void serviceInit(Configuration conf) throws Exception {
this.setIntervalMs(conf.getTimeDuration(
RBFConfigKeys.DFS_ROUTER_QUOTA_CACHE_UPDATE_INTERVAL,
RBFConfigKeys.DFS_ROUTER_QUOTA_CACHE_UPDATE_INTERVAL_DEFAULT,
TimeUnit.MILLISECONDS));
super.serviceInit(conf);
}
@Override
protected void periodicInvoke() {
LOG.debug("Start to update quota cache.");
try {
List<MountTable> mountTables = getQuotaSetMountTables();View on GitHub (pinned to 2add963021)
Solutions
- If you run a stock Router, upgrade/patch to a consistent Hadoop build - stock code cannot hit this (manager is created one line earlier in Router.serviceInit)
- In custom code, create RouterQuotaManager (set it on the Router) before instantiating RouterQuotaUpdateService, mirroring Router.serviceInit order
- If quotas are not needed, set dfs.federation.router.quota.enable=false so neither the manager nor the update service is constructed
Example fix
// before (custom router code): update service built against uninitialized router
addService(new RouterQuotaUpdateService(this)); // IOException: Router quota manager is not initialized.
// after: mirror stock Router.serviceInit
if (conf.getBoolean(RBFConfigKeys.DFS_ROUTER_QUOTA_ENABLE, RBFConfigKeys.DFS_ROUTER_QUOTA_ENABLED_DEFAULT)) {
this.quotaManager = new RouterQuotaManager();
addService(new RouterQuotaUpdateService(this));
} Defensive patterns
Strategy: validation
Validate before calling
// Guard service construction order exactly like Router.serviceInit
if (conf.getBoolean(RBFConfigKeys.DFS_ROUTER_QUOTA_ENABLE, RBFConfigKeys.DFS_ROUTER_QUOTA_ENABLED_DEFAULT)
&& router.getQuotaManager() != null) {
addService(new RouterQuotaUpdateService(router));
} else {
LOG.warn("Quota update service skipped: quota disabled or manager missing");
} Try / catch
try {
quotaUpdateService = new RouterQuotaUpdateService(router);
} catch (IOException e) {
if ("Router quota manager is not initialized.".equals(e.getMessage())) {
// construction-order bug: create RouterQuotaManager on the Router before retrying
throw new IllegalStateException("Router init order broken: quota manager must precede quota update service", e);
}
throw e;
} Prevention
- Never construct RouterQuotaUpdateService standalone; let Router.serviceInit wire it right after RouterQuotaManager
- Keep quota enable/disable configured consistently across all routers in the fleet
- Run stock Router lifecycle code; forks that reorder init must re-verify this invariant
When it happens
Trigger: The Router constructor takes the quota-enabled branch (dfs.federation.router.quota.enable=true) but router.getQuotaManager() returns null at RouterQuotaUpdateService construction - in practice only reachable via a customized Router/subclass, reflection-driven construction, or a patched router that reorders init; it aborts router startup.
Common situations: Custom router deployments or tests constructing RouterQuotaUpdateService directly against a partially initialized Router; forks of Hadoop where quota manager creation was moved or removed but the update service is still added; version skew after applying partial patches.
Related errors
- Mount table state store is not available.
- The NameSpace quota (directories and files) is exceeded: quo
- The DiskSpace quota is exceeded: quota = {} B = {} but disks
- Unknown nameservice: {}
- Storage not yet initialized for {}
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/049fd2d2a5d827f3.
Report an issue: GitHub.