{"record":{"id":"7e79a075d9a481e2","repo":"apache/hadoop","slug":"failed-to-fill-reservoir","errorCode":null,"errorMessage":"failed to fill reservoir","messagePattern":"failed to fill reservoir","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/random/OsSecureRandom.java","lineNumber":69,"sourceCode":"  private final int RESERVOIR_LENGTH = 8192;\n\n  private String randomDevPath;\n\n  private transient InputStream stream;\n\n  private final byte[] reservoir = new byte[RESERVOIR_LENGTH];\n\n  private int pos = reservoir.length;\n\n  private void fillReservoir(int min) {\n    if (pos >= reservoir.length - min) {\n      try {\n        if (stream == null) {\n          stream = Files.newInputStream(Paths.get(randomDevPath));\n        }\n        IOUtils.readFully(stream, reservoir, 0, reservoir.length);\n      } catch (IOException e) {\n        throw new RuntimeException(\"failed to fill reservoir\", e);\n      }\n      pos = 0;\n    }\n  }\n\n  public OsSecureRandom() {\n  }\n\n  @VisibleForTesting\n  public boolean isClosed() {\n    return stream == null;\n  }\n\n  @Override\n  synchronized public void setConf(Configuration conf) {\n    this.conf = conf;\n    this.randomDevPath = conf.get(\n        HADOOP_SECURITY_SECURE_RANDOM_DEVICE_FILE_PATH_KEY,","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/random/OsSecureRandom.java#L51-L87","documentation":"Error \"failed to fill reservoir\" thrown in apache/hadoop.","triggerScenarios":"Raised at runtime when the documented precondition or configuration requirement for this operation is violated.","commonSituations":"Misconfigured or missing property, invalid user input, or calling the API before its prerequisites are met.","solutions":["The OS secure random reservoir could not be filled from /dev/random; check entropy or the os.secure.random.device setting."],"exampleFix":"Set hadoop.security.random.device.file.path to /dev/urandom.","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"}