{"record":{"id":"6e74dccd59650fee","repo":"apache/dubbo","slug":"windowupdateratio-must-be-0-and-1-but-was","errorCode":null,"errorMessage":"windowUpdateRatio must be > 0 and <= 1, but was: <windowUpdateRatio>","messagePattern":"windowUpdateRatio must be > 0 and <= 1, but was: <windowUpdateRatio>","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dubbo-common/src/main/java/org/apache/dubbo/config/nested/TripleConfig.java","lineNumber":381,"sourceCode":"        return maxMessageSize == null ? DEFAULT_MAX_MESSAGE_SIZE : maxMessageSize;\n    }\n\n    public void setMaxMessageSize(Integer maxMessageSize) {\n        this.maxMessageSize = maxMessageSize;\n    }\n\n    public Float getWindowUpdateRatio() {\n        return windowUpdateRatio;\n    }\n\n    @Parameter(excluded = true)\n    public float getWindowUpdateRatioOrDefault() {\n        return windowUpdateRatio == null ? DEFAULT_WINDOW_UPDATE_RATIO : windowUpdateRatio;\n    }\n\n    public void setWindowUpdateRatio(Float windowUpdateRatio) {\n        if (windowUpdateRatio != null && (windowUpdateRatio <= 0.0f || windowUpdateRatio > 1.0f)) {\n            throw new IllegalArgumentException(\"windowUpdateRatio must be > 0 and <= 1, but was: \" + windowUpdateRatio);\n        }\n        this.windowUpdateRatio = windowUpdateRatio;\n    }\n\n    public RestConfig getRest() {\n        return rest;\n    }\n\n    @Parameter(excluded = true)\n    public RestConfig getRestOrDefault() {\n        if (rest == null) {\n            rest = new RestConfig();\n        }\n        return rest;\n    }\n\n    public void setRest(RestConfig rest) {\n        this.rest = rest;","sourceCodeStart":363,"sourceCodeEnd":399,"githubUrl":"https://github.com/apache/dubbo/blob/3a3043227f5571d25eb2889de5bca22f2914843b/dubbo-common/src/main/java/org/apache/dubbo/config/nested/TripleConfig.java#L363-L399","documentation":"Thrown by TripleConfig.setWindowUpdateRatio when the supplied ratio is outside the valid range (0, 1]. The window update ratio controls HTTP/2 flow-control update behavior for the Triple (gRPC-like) protocol, so values <= 0 or > 1 are rejected immediately on the setter. Null is allowed and means 'use default'.","triggerScenarios":"Calling setWindowUpdateRatio with a Float value that is <= 0.0f or > 1.0f. Commonly happens via configuration properties (dubbo.provider.*.triple.window-update-ratio) parsed to an out-of-range number.","commonSituations":"Misunderstanding the ratio as a percentage (e.g. setting 50 meaning 50%) instead of a fraction (0.5). Typing the property as an integer > 1 in properties/YAML. Copying a value from a different flow-control setting with a different scale.","solutions":["Set the ratio to a float strictly greater than 0 and less than or equal to 1 (e.g. 0.1 to 1.0).","Leave the property unset to use the default (DEFAULT_WINDOW_UPDATE_RATIO).","Double-check property source files (application.yml, dubbo.properties) for an out-of-range number."],"exampleFix":"// before\ntripleConfig.setWindowUpdateRatio(50f); // treated as 5000%\n\n// after\ntripleConfig.setWindowUpdateRatio(0.5f);","handlingStrategy":"validation","validationCode":"// Clamp/validate before setting\nfloat ratio = ...;\nif (ratio <= 0f || ratio > 1f) {\n    throw new IllegalArgumentException(\"windowUpdateRatio must be in (0, 1], got: \" + ratio);\n}\ntripleConfig.setWindowUpdateRatio(ratio);","typeGuard":"static boolean isValidWindowUpdateRatio(Float r) {\n    return r == null || (r > 0.0f && r <= 1.0f);\n}","tryCatchPattern":"try {\n    tripleConfig.setWindowUpdateRatio(parsedRatio);\n} catch (IllegalArgumentException e) {\n    // fall back to default and warn\n    log.warn(\"Invalid windowUpdateRatio {}, using default\", parsedRatio);\n    tripleConfig.setWindowUpdateRatio(null);\n}","preventionTips":["Treat the ratio as a fraction (0,1], not a percentage.","Validate config values from external sources (properties/env) before applying.","Leave unset to accept the framework default."],"tags":["triple","http2","flow-control","validation"],"backgroundTag":null,"analyzedSha":"3a3043227f5571d25eb2889de5bca22f2914843b","analyzedAt":"2026-08-14T00:43:19.853Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}