{"record":{"id":"09da6e8757d54b52","repo":"apache/hadoop","slug":"cache-size-is-should-be-0","errorCode":null,"errorMessage":"Cache size is {}. Should be > 0","messagePattern":"Cache size is (.+?)\\. Should be > 0","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/oncrpc/RpcCallCache.java","lineNumber":110,"sourceCode":"    public boolean equals(Object obj) {\n      if (this == obj) {\n        return true;\n      }\n      if (!(obj instanceof ClientRequest)) {\n        return false;\n      }\n      ClientRequest other = (ClientRequest) obj;\n      return clientId.equals(other.clientId) && (xid == other.xid);\n    }\n  }\n\n  private final String program;\n\n  private final Map<ClientRequest, CacheEntry> map;\n\n  public RpcCallCache(final String program, final int maxEntries) {\n    if (maxEntries <= 0) {\n      throw new IllegalArgumentException(\"Cache size is \" + maxEntries\n          + \". Should be > 0\");\n    }\n    this.program = program;\n    map = new LinkedHashMap<ClientRequest, CacheEntry>() {\n      private static final long serialVersionUID = 1L;\n\n      @Override\n      protected boolean removeEldestEntry(\n          java.util.Map.Entry<ClientRequest, CacheEntry> eldest) {\n        return RpcCallCache.this.size() > maxEntries;\n      }\n    };\n  }\n\n  /**\n   * Return the program name.\n   * @return RPC program name\n   */","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/oncrpc/RpcCallCache.java#L92-L128","documentation":"Error \"Cache size is {}. Should be > 0\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/oncrpc/RpcCallCache.java:110 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}