Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@ExecuteOn is ignored when using Micronaut Token Validator #313

Closed
4 tasks done
sebastianlavender opened this issue Jul 16, 2020 · 3 comments
Closed
4 tasks done
Assignees

Comments

@sebastianlavender
Copy link

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)

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

@jameskleeh jameskleeh transferred this issue from micronaut-projects/micronaut-core Jul 16, 2020
@jameskleeh jameskleeh self-assigned this Jul 17, 2020
@sebastianlavender
Copy link
Author

@jameskleeh is there any progress on this?

@graemerocher
Copy link
Contributor

Submitted PR micronaut-projects/micronaut-core#4301

@graemerocher
Copy link
Contributor

Will be fixed in Micronaut 2.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants