apache/hadoop · error · IllegalArgumentException
Cache size is {}. Should be > 0
Error message
Cache size is {}. Should be > 0 What it means
Error "Cache size is {}. Should be > 0" thrown in apache/hadoop.
Source
Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/oncrpc/RpcCallCache.java:110
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof ClientRequest)) {
return false;
}
ClientRequest other = (ClientRequest) obj;
return clientId.equals(other.clientId) && (xid == other.xid);
}
}
private final String program;
private final Map<ClientRequest, CacheEntry> map;
public RpcCallCache(final String program, final int maxEntries) {
if (maxEntries <= 0) {
throw new IllegalArgumentException("Cache size is " + maxEntries
+ ". Should be > 0");
}
this.program = program;
map = new LinkedHashMap<ClientRequest, CacheEntry>() {
private static final long serialVersionUID = 1L;
@Override
protected boolean removeEldestEntry(
java.util.Map.Entry<ClientRequest, CacheEntry> eldest) {
return RpcCallCache.this.size() > maxEntries;
}
};
}
/**
* Return the program name.
* @return RPC program name
*/View on GitHub (pinned to 2add963021)
Solutions
- Set the RPC duplicate-call cache size to a positive value in the configuration.
- Remove or correct the configuration property that set the cache size to zero or a negative number.
When it happens
Trigger: Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/oncrpc/RpcCallCache.java:110 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/09da6e8757d54b52.
Report an issue: GitHub.