This problem occurs in a stand-alone development environment, as well as multiple node deployment environment. I think it is reasonable to say that no matter where the service is accessed, it is a different thread, which will ensure consistent behavior.

在 2017/3/13 23:52, Valentin Kulichenko 写道:
Why would you use a thread local in a service? What design you think is
reasonable?

-Val

On Mon, Mar 13, 2017 at 2:03 PM, 李玉珏@163 <[email protected]> wrote:

Hi,

When in service grid service execution, if the local node deployment
services, will directly call the local deployment service, otherwise it
will find the service in the grid.

The local service, and the caller will use the same thread, in this case,
the two threads‘s state is different, that is to say, the same call, have
different behavior in different scene, I think the design is not reasonable.

For example, a thread local variable is defined, and according to the
above description, the value of the same variable may be different for
different scenarios.





Reply via email to