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

Specify interactions with AroundInvoke interceptors #313

Closed
Azquelt opened this issue Sep 19, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@Azquelt
Copy link
Contributor

commented Sep 19, 2018

How does Fault Tolerance interact with @AroundInvoke interceptors?

  • Does fault tolerance happen before other interceptors?
    should it be lib_after(3000, open liberty) or lib_before (1000, thorntail), safeguard (400)?

We agree on to set the initial value of platform_after + 10 (4010)
Transactional - 200

@retry
@Mylog(3)
@myprint(4)
public void myInvok() {

...
}

  1. log->print->FT->method
    most desired sequence.

  2. FT->log->print->method

  3. log->FT->print->method

  • after?
  • Is it itself in an interceptor with a specific priority?
    • Is the priority configurable?
  • How do we expect other interceptors to be called when used with
    • @Retry (interceptors later in the chain get called more than once?)
    • @Asynchronous
      • Interceptors later in the chain get called on another thread?
      • Interceptors later in the chain see the result from the method?
      • Interceptors earlier in the chain see the result placeholder returned by fault tolerance?
      • Interceptors earlier in the chain may be called and return before the invocation of the method actually starts?
    • @CircuitBreaker (interceptors later in the chain may not get called at all?)
    • @Timeout (interceptors later in the chain are included in the the timeout timer, any results they return may get discarded in favor of a TimeoutException?)

Implementation note: If Fault Tolerance is implemented as an interceptor, then the InvocationContext needs to tolerate an interceptor that

  • Doesn't call proceed() at all
  • Calls proceed() more than once
  • Calls proceed() from a different thread after the interceptor method has returned
@Emily-Jiang

This comment has been minimized.

Copy link
Member

commented Sep 26, 2018

mp.fault.tolerance.interceptor.priority=Priority.PLATFORM_AFTER+10 use this property to configure the priority if necessary

  1. When set mp.fault.tolerance.interceptor.priority = 0
@retry
@Mylog(2)
@myprint(4)
public void myInvok() {

...
}

Invocation sequence FT Retry->log->print->method. Each Retry will cause myLog, myprint to be invoked as well.

  1. When set mp.fault.tolerance.interceptor.priority = 3
    Invocation sequence Mylog -> FT Retry-> myprint->method. Each Retry will cause myprint to be invoked as well.

  2. When set mp.fault.tolerance.interceptor.priority = 6
    Invocation sequence MyLog -> myprint ->FT Retry->method. Each Retry will just cause method to be executed not the interceptors Mylog, myprint.

@Emily-Jiang

This comment has been minimized.

Copy link
Member

commented Oct 3, 2018

How do we expect other interceptors to be called when used with
@retry (see above)
@asynchronous
Interceptors later in the chain get called on another thread? yes
Interceptors later in the chain see the result from the method? yes
Interceptors earlier in the chain see the result placeholder returned by fault tolerance? yes
Interceptors earlier in the chain may be called and return before the invocation of the method actually starts? yes
@circuitbreaker (interceptors later in the chain may not get called at all?) yes
@timeout (interceptors later in the chain are included in the the timeout timer, any results they return may get discarded in favor of a TimeoutException?) yes

@Emily-Jiang

This comment has been minimized.

Copy link
Member

commented Oct 3, 2018

Revisit this issue to see what @antoinesd @brunobat find out the behaviour on Thorntail and TomiEE for placing CDI interceptors mixed with Fault Tolerance annotations on EJB beans. See code example https://github.com/Azquelt/open-liberty/blob/ejb-ft-async-bug/dev/com.ibm.ws.microprofile.faulttolerance.cdi_fat/fat/src/com/ibm/websphere/microprofile/faulttolerance_fat/tests/ejb/FaultToleranceEjbTestServlet.java

@Emily-Jiang Emily-Jiang self-assigned this Oct 3, 2018

@Emily-Jiang

This comment has been minimized.

Copy link
Member

commented Oct 3, 2018

@carlosdlr please contribute tcks for this.

@Emily-Jiang Emily-Jiang added this to the 1.2 milestone Oct 8, 2018

carlosdlr added a commit to carlosdlr/microprofile-fault-tolerance that referenced this issue Oct 17, 2018

Test to check the CDI EJB and FT interceptors ordering issue 313
eclipse#313
Signed-off-by: carlos de la rosa <kusanagi12002@gmail.com>

carlosdlr added a commit to carlosdlr/microprofile-fault-tolerance that referenced this issue Oct 23, 2018

Test fixes to check the CDI EJB and FT interceptors ordering issue 313
eclipse#313
Signed-off-by: carlos de la rosa <kusanagi12002@gmail.com>

carlosdlr added a commit to carlosdlr/microprofile-fault-tolerance that referenced this issue Oct 23, 2018

Test fixes to check the CDI EJB and FT interceptors ordering issue 313
eclipse#313
Signed-off-by: carlos de la rosa <kusanagi12002@gmail.com>

carlosdlr added a commit to carlosdlr/microprofile-fault-tolerance that referenced this issue Oct 24, 2018

Test license fix CDI EJB and FT interceptors ordering issue 313
eclipse#313
Signed-off-by: carlos de la rosa <kusanagi12002@gmail.com>

carlosdlr added a commit to carlosdlr/microprofile-fault-tolerance that referenced this issue Nov 4, 2018

Test license fix CDI EJB and FT interceptors ordering issue 313
eclipse#313

Fix related to the scope of the interceptor tests to validate the CDI
and FT interceptors ordering.
This to allow fit these tests in the MP TCK structure.

Signed-off-by: carlos de la rosa <kusanagi12002@gmail.com>

carlosdlr added a commit to carlosdlr/microprofile-fault-tolerance that referenced this issue Nov 4, 2018

Author javadoc was added
eclipse#313
Signed-off-by: carlos de la rosa <kusanagi12002@gmail.com>

Emily-Jiang pushed a commit that referenced this issue Nov 6, 2018

Emily Jiang
#313 Specify FT interceptor and the ordering policy
Signed-off-by: Emily Jiang <emijiang@uk.ibm.com>

Emily-Jiang pushed a commit that referenced this issue Nov 7, 2018

Emily Jiang
#313 address review comments
Signed-off-by: Emily Jiang <emijiang@uk.ibm.com>

Emily-Jiang pushed a commit that referenced this issue Nov 13, 2018

Emily Jiang
#313 address review comments
Signed-off-by: Emily Jiang <emijiang@uk.ibm.com>

Emily-Jiang added a commit that referenced this issue Nov 22, 2018

Merge pull request #338 from eclipse/emily_ft
#313 Specify FT interceptor and the ordering policy

carlosdlr added a commit to carlosdlr/microprofile-fault-tolerance that referenced this issue Dec 18, 2018

Test CDI (Using XML configuration) and FT interceptors ordering issue…
… 313

eclipse#313

New test added to validate the CDI interceptors against FT interceptors
when the CDI interceptors are activated using xml configuration instead
using @priority annotation configuration

Signed-off-by: carlos de la rosa <kusanagi12002@gmail.com>

carlosdlr added a commit to carlosdlr/microprofile-fault-tolerance that referenced this issue Dec 20, 2018

Test CDI and FT interceptors ordering changing
FT interceptor priority issue 313

eclipse#313

New tests added to validate the CDI interceptors against FT interceptor
when the FT interceptor priority is changed and the CDI interceptors
are injected to the context using xml or annotation base configuration.

Signed-off-by: carlos de la rosa <kusanagi12002@gmail.com>

carlosdlr added a commit to carlosdlr/microprofile-fault-tolerance that referenced this issue Jan 9, 2019

Test CDI and FT interceptors ordering changing
FT interceptor priority issue 313

eclipse#313

Fixes related to code review and use of the fault tolerance interceptor
priority parameter.

Signed-off-by: Carlos Andres De La Rosa <kusanagi12002@gmail.com>

carlosdlr added a commit to carlosdlr/microprofile-fault-tolerance that referenced this issue Jan 9, 2019

Test CDI and FT interceptors ordering changing
FT interceptor priority issue 313

eclipse#313

Fixes related to code review, order changed to make clear the test

Signed-off-by: Carlos Andres De La Rosa <kusanagi12002@gmail.com>

carlosdlr added a commit to carlosdlr/microprofile-fault-tolerance that referenced this issue Jan 10, 2019

Test CDI and FT interceptors ordering changing
FT interceptor priority issue 313

eclipse#313

Fixes related to code review, order changed to make clear the test

Signed-off-by: Carlos Andres De La Rosa <kusanagi12002@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.