{"record":{"id":"83c9a3b1b3b7608e","repo":"Netflix/Hystrix","slug":"failed-to-set-thread-pool-properties","errorCode":null,"errorMessage":"Failed to set Thread Pool properties. {}","messagePattern":"Failed to set Thread Pool properties\\. (.+?)","errorType":"exception","errorClass":"HystrixPropertyException","httpStatus":null,"severity":"error","filePath":"hystrix-contrib/hystrix-javanica/src/main/java/com/netflix/hystrix/contrib/javanica/command/GenericSetterBuilder.java","lineNumber":83,"sourceCode":"    }\n\n\n    /**\n     * Creates instance of {@link HystrixCommand.Setter}.\n     *\n     * @return the instance of {@link HystrixCommand.Setter}\n     */\n    public HystrixCommand.Setter build() throws HystrixPropertyException {\n        HystrixCommand.Setter setter = HystrixCommand.Setter\n                .withGroupKey(HystrixCommandGroupKey.Factory.asKey(groupKey))\n                .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey));\n        if (StringUtils.isNotBlank(threadPoolKey)) {\n            setter.andThreadPoolKey(HystrixThreadPoolKey.Factory.asKey(threadPoolKey));\n        }\n        try {\n            setter.andThreadPoolPropertiesDefaults(HystrixPropertiesManager.initializeThreadPoolProperties(threadPoolProperties));\n        } catch (IllegalArgumentException e) {\n            throw new HystrixPropertyException(\"Failed to set Thread Pool properties. \" + getInfo(), e);\n        }\n        try {\n            setter.andCommandPropertiesDefaults(HystrixPropertiesManager.initializeCommandProperties(commandProperties));\n        } catch (IllegalArgumentException e) {\n            throw new HystrixPropertyException(\"Failed to set Command properties. \" + getInfo(), e);\n        }\n        return setter;\n    }\n\n    // todo dmgcodevil: it would be better to reuse the code from build() method\n    public HystrixObservableCommand.Setter buildObservableCommandSetter() {\n        HystrixObservableCommand.Setter setter = HystrixObservableCommand.Setter\n                .withGroupKey(HystrixCommandGroupKey.Factory.asKey(groupKey))\n                .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey));\n        try {\n            setter.andCommandPropertiesDefaults(HystrixPropertiesManager.initializeCommandProperties(commandProperties));\n        } catch (IllegalArgumentException e) {\n            throw new HystrixPropertyException(\"Failed to set Command properties. \" + getInfo(), e);","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/Netflix/Hystrix/blob/5ce3bc58c38e7ca60ef2fe0e516e390e294ad941/hystrix-contrib/hystrix-javanica/src/main/java/com/netflix/hystrix/contrib/javanica/command/GenericSetterBuilder.java#L65-L101","documentation":"Thrown by the Javanica (annotation-based) GenericSetterBuilder when @HystrixCommand's threadPoolProperties attribute contains an entry that HystrixPropertiesManager cannot convert into a HystrixThreadPoolProperties.Setter (e.g. an unknown property name or a value that fails int/boolean parsing). The underlying IllegalArgumentException is caught, wrapped in HystrixPropertyException, and annotated with groupKey/commandKey/threadPoolKey via getInfo() so you can identify which command misconfigured it. It is raised at command-setter build time, i.e. the first time the annotated method is invoked.","triggerScenarios":"Declaring @HystrixCommand(threadPoolProperties = { @HystrixProperty(name = \"coreSize\", value = \"ten\") }) or using a property name that is not in the thread-pool property map (coreSize, maximumSize, keepAliveTimeMinutes, maxQueueSize, queueSizeRejectionThreshold, allowMaximumSizeToDivergeFromCoreSize, metrics.rollingStats.*) on a method whose setter is being built.","commonSituations":"Typos in property names in annotations; copying command-properties names (execution.isolation.thread.timeoutInMilliseconds) into threadPoolProperties; passing non-numeric strings for integer properties after refactoring a value from an externalized config string.","solutions":["Check the exception's getInfo() output (groupKey/commandKey/threadPoolKey) to find the offending @HystrixCommand method","Verify every @HystrixProperty name under threadPoolProperties against HystrixPropertiesManager's THREAD_POOL_PROP_MAP (coreSize, maximumSize, keepAliveTimeMinutes, maxQueueSize, queueSizeRejectionThreshold, metrics.rollingStats.timeInMilliseconds, etc.)","Verify each value parses as the expected type (int/boolean) — e.g. use \"10\" not \"ten\"","Remove or correct the invalid property and restart; the error is deterministic, not transient"],"exampleFix":"// before\n@HystrixCommand(threadPoolProperties = {\n    @HystrixProperty(name = \"coreSize\", value = \"ten\")\n})\npublic String call() { ... }\n\n// after\n@HystrixCommand(threadPoolProperties = {\n    @HystrixProperty(name = \"coreSize\", value = \"10\")\n})\npublic String call() { ... }","handlingStrategy":"validation","validationCode":"Set<String> VALID_TP = new HashSet<>(Arrays.asList(\n    \"coreSize\", \"maximumSize\", \"keepAliveTimeMinutes\", \"maxQueueSize\",\n    \"queueSizeRejectionThreshold\", \"allowMaximumSizeToDivergeFromCoreSize\",\n    \"metrics.rollingStats.timeInMilliseconds\", \"metrics.rollingStats.numBuckets\"));\n\n// in a startup check, for each annotated method:\nHystrixCommand ann = m.getAnnotation(HystrixCommand.class);\nif (ann != null) {\n  for (HystrixProperty p : ann.threadPoolProperties()) {\n    if (!VALID_TP.contains(p.name()))\n      throw new IllegalStateException(m + \" invalid threadPool property \" + p.name());\n  }\n}","typeGuard":null,"tryCatchPattern":"catch (HystrixPropertyException e) { log.error(\"Bad threadPoolProperties on command\", e); /* fail startup — config error is deterministic */ }","preventionTips":["Centralize @HystrixProperty name/value constants instead of inline strings","Add a startup reflection scan validating all @HystrixCommand annotations","Keep property names in one place per version; re-verify after Hystrix upgrades"],"tags":["hystrix","javanica","configuration","thread-pool","annotation"],"backgroundTag":null,"analyzedSha":"5ce3bc58c38e7ca60ef2fe0e516e390e294ad941","analyzedAt":"2026-08-14T10:55:35.600Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}