Oh, I haven’t been able to simulate my guess.发送自我的三星盖乐世智能手机。
原始信息 由: Zheng Feng 日期: 2019/4/26 18:52
(GMT+08:00) 收件人: dev@servicecomb.apache.org 主题: Re: [Saga] About Omega's
timeout process Why does this happen I mean that Thread.interrupt causes the
ThreadLocalvariables lost
Why does this happen I mean that Thread.interrupt causes the ThreadLocal
variables lost the value ? It should be running in the same thread. Also it
does not mention in the Java API docs [1].
I do agree that the compensate method could have this issue since it has
been invoking in the different
Yeah, that's exactly what want to say.
Willem Jiang
Twitter: willemjiang
Weibo: 姜宁willem
On Fri, Apr 26, 2019 at 4:14 PM Zhang Lei wrote:
>
> Hi, Willem Jiang
>
> You mean that Thread.interrupt will cause the variables in the thread to be
> lost, so we need to provide a way for the user to
Hi, Willem Jiang
You mean that Thread.interrupt will cause the variables in the thread to be
lost, so we need to provide a way for the user to restore the thread variables?
Lei Zhang
> 在 2019年4月26日,上午8:36,Willem Jiang 写道:
>
> We could introduce a Context object to let the user copy the
We could introduce a Context object to let the user copy the thread
local variable across the thread.
The context can be inject into the method which is annotated with
Compasiable. We may need to inject the Context object into the remote
service caller.
Willem Jiang
Twitter: willemjiang
Weibo:
I'm not sure if the Thread.interrupt() could be working as you expect. From
the Java doc [1]
Unless the current thread is interrupting itself, which is always
permitted, the checkAccess method of this thread is invoked, which may
cause a SecurityException to be thrown.
- If this thread is
In my example, I defined a runtime exception TimeoutAspectException, user can
know that a timeout has occurred when catching the exception
The following unit test case tested a custom exception TimeoutAspectException
@Test(expected = TimeoutAspectException.class)
public void
Yeah, I think it's a good start.
In this way we could let the SagaStarter and LocalTransaction
excecutor knows about the timeout.
As the calling thread is change, we need to tell the user about it.
Willem Jiang
Twitter: willemjiang
Weibo: 姜宁willem
On Wed, Apr 24, 2019 at 7:09 PM Zhang Lei