Open sevenhe1205 opened 1 year ago
Thanks! Sorry I didn't get around to reviewing until now. Curious if you are using this add/remove endpoints feature in production?
yes, Service discovery requires grpcbox to have the ability to dynamic and drop endpoints, which we are ready to use in production
@sevenhe1205 can you rebase these changes?
I'm going to make a new grpcbox release but then would like to get your changes merged in and another release made.
@sevenhe1205 can you rebase these changes?
I'm going to make a new grpcbox release but then would like to get your changes merged in and another release made.
I lost my previous account, and this is a new one. I will rebase to the latest main branch. We discovered a new issue: when using the hash strategy, grpc_pool may cause the program to crash when adding and deleting workers. Therefore, we don't use the hash strategy in actual applications. Instead, we use the direct pick strategies.
Fix functions parametes
Fix the value of the Name parameter passed to the subchannel in gproc_pool's disconnect_worker and remove_worker functions.
grpcbox_subchannel contains three properties: Channel, endpoint, and Name. During initialization, grpcbox_subchannel calls the gproc_pool:connect_worker function with Channel and Name as parameters. When terminating, grpcbox_subchannel calls the gproc_pool:disconnect_worker and gproc_pool:remove_worker functions with incorrect parameters channel and endpoint. The correct parameters to use are channel and name.
Add and remove dynamic endpoints
Add hash and direct pick strategies