Sentinel ProcessorSlot should be stateless

rseugnpd  于 2021-11-29  发布在  Java
关注(0)|答案(4)|浏览(312)

Issue Description

Now sentinel will create a new list for every resource because some of the slots are bound to specific resource.

Describe what happened (or what feature you want)

Many slots will be created in memory.

Describe what you expected to happen

They should be reusable.

Anything else we need to know?

Related slots are ClusterBuilderSlot and NodeSelectorSlot.

vyswwuz2

vyswwuz21#

I think we can split it to some step:

First , we can cache stateless slot instance to reuse when build slotchain. This can reduce repeated creation of slot.
Then we can make other slots statless in future.

chy5wohz

chy5wohz2#

I think we can split it to some step:

First , we can cache stateless slot instance to reuse when build slotchain. It can reduce repeated creation of slot.
Then we can make other slots statless in future.

hfwmuf9z

hfwmuf9z3#

it is tough since almost all the slots had a state. They have to maintain their next one

n8ghc7c1

n8ghc7c14#

if AuthoritySlot and StatisticSlot and SystemSlot are the fixed-last three, they could be defined as singleton. i checked DefaultSlotChainBuilder found they could be custom ordered now 😬

相关问题