HttpTask readTimeOut configuration from task input does not work, readTimeOut always max to default 3 minutes
Describe the bug Create a http task to call some url and this url will block to response for a long time. And I config readTimeOut as 300000ms (5 minutes), but after 3 minutes later, an exception throw out: Failed to invoke HTTP task due to: java.lang.Exception: I/O error on POST request for "http://xxx.com/iac/v1/execute/cxxx": Read timed out
Details Conductor version: 3.21.18 Persistence implementation: Postgres Queue implementation: Postgres Lock: Redis Workflow definition: Task definition: Event handler definition:
To Reproduce test case like following:
@GetMapping("test") public String test() { StopWatch stopWatch = new StopWatch("http task run time statistic"); stopWatch.start("task started at " + LocalDateTime.now()); System.out.println("task started at " + LocalDateTime.now()); try { HttpTask.Input input = this.objectMapper.readValue("{ "headers": {}, "method": "POST", "readTimeOut": 300000, "body": { "nextExecute1": null, "preV2": null, "preV1": null, "retryNum": "10", "test": "false", "extendParam": null, "param": "aabb", "orderRequestTaskId": "ba7870be-67e6-4fee-8bf1-25987c3433d9", "platform": "SELF", "retrySleepTime": "3600000", "nextExecute2": null }, "uri": "http://xxx.com/iac/v1/execute/cxxx", "connectionTimeOut": 3600000 }", HttpTask.Input.class); RestTemplate restTemplate = this.restTemplateProvider.getRestTemplate(input); HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.valueOf(input.getContentType())); headers.setAccept(Collections.singletonList(MediaType.valueOf(input.getAccept()))); input.getHeaders().forEach( (key, value) -> { if (value != null) { headers.add(key, value.toString()); } }); HttpEntity<Object> request = new HttpEntity<>(input.getBody(), headers); ResponseEntity<String> responseEntity = restTemplate.exchange( input.getUri(), HttpMethod.valueOf(input.getMethod()), request, String.class); } catch (Exception e) { System.out.println(e); } stopWatch.stop(); System.out.println(stopWatch.prettyPrint()); return "test"; }
Expected behavior It should timeout in 5 minutes but in fact is 3 minutes by the default config of HttpComponentsClientHttpRequestFactory
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.
I have pushed a pr for this issue: https://github.com/conductor-oss/conductor/pull/579