saravanakumar1987 opened a new pull request, #31406: URL: https://github.com/apache/camel/pull/31406
# Description Fixes [CAMEL-28124](https://issues.apache.org/jira/browse/CAMEL-28124). ## Summary The client that the endpoint created waited at most 10 seconds for a response. So `invokeFunction` failed for a function that ran longer than 10 seconds. The new `readTimeout` option sets this time in milliseconds, and a route without it keeps 10 seconds. - `FCEndpoint` has the new `readTimeout` option, an `Integer` with the label `advanced` and no default value. - `FCUtils.createTeaConfig` passes it to `Config.setReadTimeout` only when it is set. - A negative value fails with an `IllegalArgumentException` that names the option, before the endpoint creates the client. - The doc page has a section on the read timeout of `invokeFunction`. ### Why the option reaches OkHttp `Client.invokeFunction` of fc_open20210406 2.1.0 passes `RuntimeOptions` without a read timeout. So tea-openapi 0.3.21 passes `Config.readTimeout` to tea 1.4.3, which builds its OkHttp 4.12.0 client with it. The cache of OkHttp clients in tea has the read timeout in its key. OkHttp takes 0 as no timeout. ## Tests - `ReadTimeoutTest` mocks the client constructor and checks that 60000 and 0 reach the config of the client. - It checks that the error for -1 names the option, and that the endpoint keeps the client of `fcClient`. - All 4 tests failed before the change, as the endpoint did not know the option. - The module build ran 23 tests and the catalog build 156 tests of `CamelCatalogTest`, none of them skipped or failed. # Target - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch) # Tracking - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it). # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [x] I ran `mvn clean install -Dquickly -DskipTests` on the parent commit, and resumed it from camel-kserve with `-Dgrpc-version=1.85.1`. Then I ran `mvn install -nsu` in camel-alibaba-fc, catalog/camel-catalog (`-Dtest=CamelCatalogTest`) and both DSL modules (`-DskipTests`), and committed all generated changes. # AI-assisted contributions - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used. _Claude Code on behalf of saravanakumar1987_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
