{"record":{"id":"a447bc02aecdbf83","repo":"apache/cassandra","slug":"user-defined-functions-warn-timeout-must-less-than","errorCode":null,"errorMessage":"user_defined_functions_warn_timeout must less than user_defined_function_fail_timeout","messagePattern":"user_defined_functions_warn_timeout must less than user_defined_function_fail_timeout","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":1110,"sourceCode":"        }\n\n        // we need this assignment for the Settings virtual table - CASSANDRA-17735\n        conf.counter_cache_size = new DataStorageSpec.LongMebibytesBound(counterCacheSizeInMiB);\n\n        // if set to empty/\"auto\" then use 5% of Heap size\n        indexSummaryCapacityInMiB = (conf.index_summary_capacity == null)\n                                    ? Math.max(1, (int) (Runtime.getRuntime().totalMemory() * 0.05 / 1024 / 1024))\n                                    : conf.index_summary_capacity.toMebibytes();\n\n        if (indexSummaryCapacityInMiB < 0)\n            throw new ConfigurationException(\"index_summary_capacity option was set incorrectly to '\"\n                                             + conf.index_summary_capacity.toString() + \"', it should be a non-negative integer.\", false);\n\n        // we need this assignment for the Settings virtual table - CASSANDRA-17735\n        conf.index_summary_capacity = new DataStorageSpec.LongMebibytesBound(indexSummaryCapacityInMiB);\n\n        if (conf.user_defined_functions_fail_timeout.toMilliseconds() < conf.user_defined_functions_warn_timeout.toMilliseconds())\n            throw new ConfigurationException(\"user_defined_functions_warn_timeout must less than user_defined_function_fail_timeout\", false);\n\n        if (!conf.allow_insecure_udfs && !conf.user_defined_functions_threads_enabled)\n            throw new ConfigurationException(\"To be able to set enable_user_defined_functions_threads: false you need to set allow_insecure_udfs: true - this is an unsafe configuration and is not recommended.\");\n\n        if (conf.allow_extra_insecure_udfs)\n            logger.warn(\"Allowing java.lang.System.* access in UDFs is dangerous and not recommended. Set allow_extra_insecure_udfs: false to disable.\");\n\n        if (conf.scripted_user_defined_functions_enabled)\n            throw new ConfigurationException(\"JavaScript user-defined functions were removed in CASSANDRA-18252. \" +\n                                             \"Hooks are planned to be introduced as part of CASSANDRA-17280\");\n\n        if (conf.commitlog_segment_size.toMebibytes() == 0)\n            throw new ConfigurationException(\"commitlog_segment_size must be positive, but was \"\n                                             + conf.commitlog_segment_size.toString(), false);\n        else if (conf.commitlog_segment_size.toMebibytes() >= 2048)\n            throw new ConfigurationException(\"commitlog_segment_size must be smaller than 2048, but was \"\n                                             + conf.commitlog_segment_size.toString(), false);\n","sourceCodeStart":1092,"sourceCodeEnd":1128,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L1092-L1128","documentation":"Thrown when user_defined_functions_fail_timeout is smaller than user_defined_functions_warn_timeout in cassandra.yaml. Cassandra requires warn < fail so the warning fires before the hard failure deadline; violating that ordering is rejected during applySimpleConfig.","triggerScenarios":"cassandra.yaml sets fail_timeout lower than warn_timeout, e.g. warn_timeout: 1000ms with fail_timeout: 500ms.","commonSituations":"Operators tightening the fail timeout after UDF hangs but forgetting to adjust the warn timeout; config templates where the two values were swapped.","solutions":["Ensure user_defined_functions_warn_timeout < user_defined_functions_fail_timeout in cassandra.yaml (swap or raise the fail timeout).","Restart the node."],"exampleFix":"# before\nuser_defined_functions_warn_timeout: 5000ms\nuser_defined_functions_fail_timeout: 3000ms\n# after\nuser_defined_functions_warn_timeout: 2000ms\nuser_defined_functions_fail_timeout: 5000ms","handlingStrategy":"validation","validationCode":"long warn = parseMillis(yaml.get(\"user_defined_functions_warn_timeout\"));\nlong fail = parseMillis(yaml.get(\"user_defined_functions_fail_timeout\"));\nif (warn >= fail) throw new IllegalArgumentException(\"udf warn_timeout must be < fail_timeout\");","typeGuard":null,"tryCatchPattern":"try {\n    DatabaseDescriptor.applySimpleConfig();\n} catch (ConfigurationException e) {\n    if (e.getMessage().contains(\"user_defined_functions_warn_timeout\"))\n        logger.error(\"Reorder UDF timeouts so warn < fail in cassandra.yaml\");\n}","preventionTips":["When changing one UDF timeout, always check the other","Default warn=500ms fail=1000ms ordering","Treat the pair as a single coupled setting in config templates"],"tags":["config","udf","validation"],"backgroundTag":"conflicting-config-options","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}