pinpoint-plugin-sample icon indicating copy to clipboard operation
pinpoint-plugin-sample copied to clipboard

Sample12 Async trace AsyncInitiatorInterceptor seems useless

Open zlp1992 opened this issue 4 years ago • 1 comments

Hi, In Sample12 async trace, it says we should intercept a method initiating an async task and create/record a new AsyncContext, so it intercepts TargetClass12_AsyncInitiator's method asyncHello then intercepts TargetClass12_Worker constructor method to get the AsyncContext passed by AsyncInitiatorInterceptor. My question is why not create/record a new AsyncContext in the TargetClass12_Worker constructor method interceptor, since TargetClass12_Worker's constructor method is executed in current thread while it's run method executed in another thread, So we can remove AsyncInitiatorInterceptor.

zlp1992 avatar Oct 27 '20 07:10 zlp1992

Anyone knows?

zlp1992 avatar Nov 03 '20 08:11 zlp1992