You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
ClientManager stored each client register and subscribe which services, which is client to service index. for most of query situation, we prefer to get all service instances or subsribers which is service to client.
So ClientServiceIndexesManager is the index manager of transfering client to service to service to client.
But in some situation, there is one problem for concurrent handle ClientEvent.ClientDisconnectEvent and ClientOperationEvent.ClientRegisterServiceEvent.
For example:
Client A is disconnect first, and at the same time, the client also redo register to nacos. It will has an order for disconnect and register. whatever the order is, we expect the event handled in ClientServiceIndexesManager can be the same order.
Client A disconnect --> Client A redo register --> publish ClientDisconnectEvent --> ClientRegisterServiceEvent
But The two event are ClientEvent based and ClientOperationEvent based, which will be handled in EventCenter by two different query and thread, and no way to force the order between them.
It may cause: Client A disconnect --> Client A redo register --> ClientRegisterServiceEvent --> publish ClientDisconnectEvent
The case will make the index lost the client A data and not show in console and for subscribe.
The case is hard to disappear, but it's possible
Expected behavior
The index handled order same as the client operation order.
Actually behavior
async handle in some extreme scene.
Additional context
I think we can add an ClientOperationEvent like named releaseData or releaseClient, publish this event at the same time with ClientOperationEvent.ClientRegisterServiceEvent.
And ClientServiceIndexesManager use new event replace ClientOperationEvent.ClientRegisterServiceEvent, it can make the event order same as the operate order.
The text was updated successfully, but these errors were encountered:
Describe the bug
ClientManager stored each client register and subscribe which services, which is client to service index. for most of query situation, we prefer to get all service instances or subsribers which is service to client.
So ClientServiceIndexesManager is the index manager of transfering
client to service
toservice to client
.But in some situation, there is one problem for concurrent handle
ClientEvent.ClientDisconnectEvent
andClientOperationEvent.ClientRegisterServiceEvent
.For example:
Client A is disconnect first, and at the same time, the client also redo register to nacos. It will has an order for
disconnect
andregister
. whatever the order is, we expect the event handled in ClientServiceIndexesManager can be the same order.Client A disconnect --> Client A redo register --> publish ClientDisconnectEvent --> ClientRegisterServiceEvent
But The two event are ClientEvent based and ClientOperationEvent based, which will be handled in EventCenter by two different query and thread, and no way to force the order between them.
It may cause:
Client A disconnect --> Client A redo register --> ClientRegisterServiceEvent --> publish ClientDisconnectEvent
The case will make the index lost the client A data and not show in console and for subscribe.
The case is hard to disappear, but it's possible
Expected behavior
The index handled order same as the client operation order.
Actually behavior
async handle in some extreme scene.
Additional context
I think we can add an ClientOperationEvent like named
releaseData
orreleaseClient
, publish this event at the same time withClientOperationEvent.ClientRegisterServiceEvent
.And ClientServiceIndexesManager use new event replace
ClientOperationEvent.ClientRegisterServiceEvent
, it can make the event order same as the operate order.The text was updated successfully, but these errors were encountered: