{"record":{"id":"ce305f526b0c5a40","repo":"apache/hadoop","slug":"the-flush-interval-property-must-be-at-least-1-min","errorCode":null,"errorMessage":"The flush interval property must be at least 1 minute. Value was ${rollInterval}","messagePattern":"The flush interval property must be at least 1 minute\\. Value was (.+?)","errorType":"exception","errorClass":"MetricsException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/RollingFileSystemSink.java","lineNumber":394,"sourceCode":"          break;\n        case \"d\":\n        case \"day\":\n        case \"days\":\n          millis = TimeUnit.DAYS.toMillis(rollIntervalInt);\n          break;\n        default:\n          throw new MetricsException(\"Unrecognized unit for flush interval: \"\n              + flushUnit + \". Must be one of: minute, hour, day\");\n        }\n      }\n    } else {\n      throw new MetricsException(\"Unrecognized flush interval: \"\n          + rollInterval + \". Must be a number followed by an optional unit.\"\n          + \" The unit must be one of: minute, hour, day\");\n    }\n\n    if (millis < 60000) {\n      throw new MetricsException(\"The flush interval property must be \"\n          + \"at least 1 minute. Value was \" + rollInterval);\n    }\n\n    return millis;\n  }\n\n  /**\n   * Return the property value if it's non-negative and throw an exception if\n   * it's not.\n   *\n   * @param key the property key\n   * @param defaultValue the default value\n   */\n  private long getNonNegative(String key, int defaultValue) {\n    int flushOffsetIntervalMillis = properties.getInt(key, defaultValue);\n\n    if (flushOffsetIntervalMillis < 0) {\n      throw new MetricsException(\"The \" + key + \" property must be \"","sourceCodeStart":376,"sourceCodeEnd":412,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/RollingFileSystemSink.java#L376-L412","documentation":"After parsing, the roll interval is converted to milliseconds and must be at least 60000 (one minute); smaller values throw 'The flush interval property must be at least 1 minute. Value was <rollInterval>'. Since the smallest supported unit is minutes, the realistic way to hit this is a zero quantity — the sink deliberately forbids sub-minute or disabled rolling.","triggerScenarios":"roll-interval=0 (bare number = 0 hours = 0 ms), roll-interval=0minutes, roll-interval=0day.","commonSituations":"Trying to disable rolling by setting the interval to 0; intending a sub-minute interval; leaving the property set to 0 in a template.","solutions":["Set at least roll-interval=1minute","If the goal was to disable the sink, remove the sink configuration lines instead of zeroing roll-interval","If a very frequent roll was intended, reconsider — the minimum is a hard floor of 1 minute by design"],"exampleFix":"# before\n*.sink.rolling.roll-interval=0  # interpreted as 0 hours -> below 1-minute floor\n\n# after\n*.sink.rolling.roll-interval=1minute","handlingStrategy":"validation","validationCode":"// after parsing per sink rules, before applying:\nif (parsedMillis < 60000L) {\n  throw new IllegalArgumentException(\"roll-interval '\" + rollInterval\n      + \"' resolves to \" + parsedMillis + \" ms; minimum is 1 minute\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  sink.init(subsetConf);\n} catch (MetricsException e) {\n  // 'must be at least 1 minute' — almost always roll-interval=0\n  LOG.error(\"roll-interval '{}' below the 1-minute floor; set 1minute or larger\", rollInterval, e);\n}","preventionTips":["Never zero roll-interval to 'disable' rolling — remove the sink config instead","Treat 1minute as the smallest legal value when templating configs","Remember a bare number is hours, so '0' means zero hours and always trips this check"],"tags":["metrics2","rolling-file-sink","configuration","range","validation"],"backgroundTag":"config-value-out-of-range","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}