{"record":{"id":"86eef78a4468cc76","repo":"alibaba/nacos","slug":"min-check-time-for-http-or-tcp-is-too-small-500","errorCode":null,"errorMessage":"min check time for http or tcp is too small(<500)","messagePattern":"min check time for http or tcp is too small\\(<500\\)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"naming/src/main/java/com/alibaba/nacos/naming/misc/SwitchManager.java","lineNumber":387,"sourceCode":"        switchDomain.setPushGoVersion(newSwitchDomain.getPushVersionOfGo());\n        switchDomain.setPushJavaVersion(newSwitchDomain.getPushVersionOfJava());\n        switchDomain.setPushPythonVersion(newSwitchDomain.getPushVersionOfPython());\n        switchDomain.setPushCVersion(newSwitchDomain.getPushVersionOfC());\n        switchDomain.setPushCSharpVersion(newSwitchDomain.getPushVersionOfCsharp());\n        switchDomain.setEnableAuthentication(newSwitchDomain.isEnableAuthentication());\n        switchDomain.setOverriddenServerStatus(newSwitchDomain.getOverriddenServerStatus());\n        switchDomain.setDefaultInstanceEphemeral(newSwitchDomain.isDefaultInstanceEphemeral());\n        switchDomain.setLightBeatEnabled(newSwitchDomain.isLightBeatEnabled());\n    }\n    \n    /**\n     * Validate health params.\n     *\n     * @param healthParams health params\n     */\n    public void validateHealthParams(SwitchDomain.HealthParams healthParams) {\n        if (healthParams.getMin() < SwitchDomain.HttpHealthParams.MIN_MIN) {\n            throw new IllegalArgumentException(\"min check time for http or tcp is too small(<500)\");\n        }\n        \n        if (healthParams.getMax() < SwitchDomain.HttpHealthParams.MIN_MAX) {\n            \n            throw new IllegalArgumentException(\n                \"max check time for http or tcp is too small(<3000)\");\n        }\n        \n        if (healthParams.getFactor() < 0 || healthParams.getFactor() > 1) {\n            \n            throw new IllegalArgumentException(\"malformed factor\");\n        }\n    }\n    \n    private void updateWithConsistency(SwitchDomain tempSwitchDomain) throws NacosException {\n        try {\n            final BatchWriteRequest req = new BatchWriteRequest();\n            String switchDomainKey = KeyBuilder.getSwitchDomainKey();","sourceCodeStart":369,"sourceCodeEnd":405,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/naming/src/main/java/com/alibaba/nacos/naming/misc/SwitchManager.java#L369-L405","documentation":"Thrown by validateHealthParams when healthParams.getMin() < SwitchDomain.HttpHealthParams.MIN_MIN (500 ms). This is the minimum health-check interval; values below 500ms would cause excessive health-check traffic. Applies to both http and tcp health params (both call validateHealthParams).","triggerScenarios":"PUT /v3/admin/ns/operator/switches with entry=httpHealthParams or tcpHealthParams and a valid JSON whose 'min' field is < 500, e.g. {\"min\":100,\"max\":5000,\"factor\":0.85}.","commonSituations":"Aggressive health-check tuning, or confusing min with factor.","solutions":["Set the 'min' field to >= 500 (milliseconds).","Ensure min <= max and both are reasonable for your check type."],"exampleFix":"// before\nPUT /v3/admin/ns/operator/switches?entry=httpHealthParams&value={\"min\":100,\"max\":5000,\"factor\":0.85}\n// after\nPUT /v3/admin/ns/operator/switches?entry=httpHealthParams&value={\"min\":500,\"max\":5000,\"factor\":0.85}","handlingStrategy":"validation","validationCode":"if (healthParams.getMin() < 500) {\n    throw new IllegalArgumentException(\"Health check min must be >= 500ms\");\n}","typeGuard":"function isValidMin(min: number): boolean {\n  return min >= 500;\n}","tryCatchPattern":"try {\n  operatorV2Impl.updateSwitch(entry, json, debug);\n} catch (NacosApiException e) {\n  if (e.getMessage().includes(\"min check time\")) {\n    params.min = 500; // clamp\n    json = JSON.stringify(params);\n  }\n}","preventionTips":["Keep health-check min >= 500ms.","Ensure min <= max."],"tags":["naming","switch","validation","health-params"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}