You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a method using the @timeout(500) annotation invokes a long duration remote service using MP RestClient, the TimeoutException occurs after 2 seconds.
Create a service A with the following code that access a service B (running at http://localhost:8081/test) That takes 10 seconds to reply (You can use Thread.sleep).
Service A:
@Timeout(500)
@GET
public String checkTimeout() throws IllegalStateException, RestClientDefinitionException, MalformedURLException {
RestClientBuilder
.newBuilder()
.baseUrl(new URL("http://localhost:8081/"))
.build(RemoteService.class)
.test();
return "Never from normal processing";
}
@Path("/test")
@RegisterRestClient
interface RemoteService {
@GET
@Produces(MediaType.TEXT_PLAIN)
public String test();
}
if used without @Asynchronous there are some cases in which a thread cannot be interrupted. I will investigate if this is related to the CommandRetrier, but regardless that's something to keep in mind.
Environment Details
Problem Description
When a method using the @timeout(500) annotation invokes a long duration remote service using MP RestClient, the TimeoutException occurs after 2 seconds.
The expected TimeoutException should occur after 500ms. This is due to https://github.com/oracle/helidon/blob/master/microprofile/fault-tolerance/src/main/java/io/helidon/microprofile/faulttolerance/CommandRetrier.java class that uses a default retryValue of 2 retries attempts with 1 second each. The @timeout annotation is not being considered here.
Steps to reproduce
Create a service A with the following code that access a service B (running at http://localhost:8081/test) That takes 10 seconds to reply (You can use Thread.sleep).
Service A:
Service B
The text was updated successfully, but these errors were encountered: