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

Microprofile Rest Client's AsyncInvocationInterceptor has wrong lifecycle #4264

Closed
pdudits opened this issue Sep 20, 2019 · 2 comments · Fixed by #4272
Closed

Microprofile Rest Client's AsyncInvocationInterceptor has wrong lifecycle #4264

pdudits opened this issue Sep 20, 2019 · 2 comments · Fixed by #4272
Assignees

Comments

@pdudits
Copy link
Contributor

pdudits commented Sep 20, 2019

AsyncInvocationInterceptors should intercept single asynchronous invocation with following lifecycle:

  • new interceptor is created for every async invocation
  • prepareContext() is invoked just before the invocation leaves the main thread
  • applyContext() is invoked on executing thread before invocation proceeds
  • removeContext() is invoked on executing thread after invocation finishes

Current lifecycle is as follows

  • one interceptor per client instance is created
  • prepareContext() is invoked at the time of creation

The other methods are invoked as above. Effectively it means, that any interceptors have correct context only at first use, and only if client is already created in correct context (i. e. not on startup).

@pdudits
Copy link
Contributor Author

pdudits commented Sep 20, 2019

I might have capacity to provide a PR next month

Verdent added a commit to Verdent/jersey that referenced this issue Sep 24, 2019
Verdent added a commit to Verdent/jersey that referenced this issue Sep 24, 2019
@Verdent
Copy link
Member

Verdent commented Sep 24, 2019

@pdudits Thank you for this find. I have totally missed this behavior.

Verdent added a commit that referenced this issue Oct 3, 2019
)

* Fixes #4264 - AsyncInvocationinverceptors not properly created for each request

Signed-off-by: David Kral <[email protected]>
pdudits pushed a commit to pdudits/patched-src-jersey that referenced this issue Oct 10, 2019
…lipse-ee4j#4272)

* Fixes eclipse-ee4j#4264 - AsyncInvocationinverceptors not properly created for each request

Signed-off-by: David Kral <[email protected]>
pdudits pushed a commit to payara/patched-src-jersey that referenced this issue Oct 14, 2019
…lipse-ee4j#4272)

* Fixes eclipse-ee4j#4264 - AsyncInvocationinverceptors not properly created for each request

Signed-off-by: David Kral <[email protected]>
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

Successfully merging a pull request may close this issue.

2 participants