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 using @ExecuteOn from within a controller in conjunction with Micronauts Token Validator the effect of the @ExecuteOn is ignored. The Token Validator uses the eventloop and carries this over to the controller and any subsequent method from within the controller continues on the eventloop.
This causes the same issue as reported in micronaut-projects/micronaut-core#3694 meaning that the clients experience io.micronaut.http.client.exceptions.ReadTimeoutException
Task List
Steps to reproduce provided
Stacktrace (if present) provided
Example that reproduces the problem uploaded to Github
Full description of the issue provided (see below)
Run from command line ./gradlew test -debug to see stacktrace (provided below) being produced.
Import into IDE of your choice and run test StatusIntegrationSpec
If StatusIntegrationSpec test is run with CONCURRENT_REQUESTS_COUNT(field defined in the test) value as 20 the issue is reproduced reliably.
Stacktrace:
io.micronaut.http.client.exceptions.ReadTimeoutException: Read Timeout at io.micronaut.http.client.exceptions.ReadTimeoutException.(ReadTimeoutException.java:26) at io.micronaut.http.client.DefaultHttpClient.lambda$null$29(DefaultHttpClient.java:1090) at io.reactivex.internal.operators.flowable.FlowableOnErrorNext$OnErrorNextSubscriber.onError(FlowableOnErrorNext.java:103) at io.micronaut.reactive.rxjava2.RxInstrumentedSubscriber.onError(RxInstrumentedSubscriber.java:83) at io.reactivex.internal.operators.flowable.FlowableTimeoutTimed$TimeoutSubscriber.onTimeout(FlowableTimeoutTimed.java:139) at io.reactivex.internal.operators.flowable.FlowableTimeoutTimed$TimeoutTask.run(FlowableTimeoutTimed.java:170) at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66) at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
Expected Behaviour
Referring to the repo provided:
Test should pass with no error being thrown ie all responses from Status endpoint should return 200.
Actual Behaviour
Referring to the repo provided:
When status endpoint is hit with 20 concurrent requests, the http client fails with ReadTimeout error.
When using @ExecuteOn from within a controller in conjunction with Micronauts Token Validator the effect of the @ExecuteOn is ignored. The Token Validator uses the eventloop and carries this over to the controller and any subsequent method from within the controller continues on the eventloop.
This causes the same issue as reported in micronaut-projects/micronaut-core#3694 meaning that the clients experience io.micronaut.http.client.exceptions.ReadTimeoutException
Task List
Steps to Reproduce
Please see and run StatusIntegationSpec test at: https://github.com/sebastianlavender/micronaut-http to reproduce the issue
Run from command line ./gradlew test -debug to see stacktrace (provided below) being produced.
Import into IDE of your choice and run test StatusIntegrationSpec
If StatusIntegrationSpec test is run with CONCURRENT_REQUESTS_COUNT(field defined in the test) value as 20 the issue is reproduced reliably.
Stacktrace:
io.micronaut.http.client.exceptions.ReadTimeoutException: Read Timeout at io.micronaut.http.client.exceptions.ReadTimeoutException.(ReadTimeoutException.java:26) at io.micronaut.http.client.DefaultHttpClient.lambda$null$29(DefaultHttpClient.java:1090) at io.reactivex.internal.operators.flowable.FlowableOnErrorNext$OnErrorNextSubscriber.onError(FlowableOnErrorNext.java:103) at io.micronaut.reactive.rxjava2.RxInstrumentedSubscriber.onError(RxInstrumentedSubscriber.java:83) at io.reactivex.internal.operators.flowable.FlowableTimeoutTimed$TimeoutSubscriber.onTimeout(FlowableTimeoutTimed.java:139) at io.reactivex.internal.operators.flowable.FlowableTimeoutTimed$TimeoutTask.run(FlowableTimeoutTimed.java:170) at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66) at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
Expected Behaviour
Referring to the repo provided:
Test should pass with no error being thrown ie all responses from Status endpoint should return 200.
Actual Behaviour
Referring to the repo provided:
When status endpoint is hit with 20 concurrent requests, the http client fails with ReadTimeout error.
Environment Information
Operating System: MacOS Catalina 10.15.4
Micronaut Version: 2.0.0
JDK Version: 1.8
Example Application
https://github.com/sebastianlavender/micronaut-http
The text was updated successfully, but these errors were encountered: