@@ -35,7 +35,8 @@ func init() {
3535}
3636
3737func initPoolEnabledFromEnv () {
38- // allow disabling by env without modifying the code and recompiling
38+ // Keep migration-only env switches for compatibility with existing
39+ // deployments while RPCInfo pooling is being phased out.
3940 if os .Getenv ("KITEX_DISABLE_RPCINFO_POOL" ) != "" {
4041 EnablePool (false )
4142 }
@@ -53,9 +54,10 @@ func initPoolEnabledFromEnv() {
5354// By turning off the pool, we can quickly confirm whether the concurrency issues is
5455// caused by such cases, but do remember there's a PERFORMANCE LOSS.
5556//
56- // Deprecated: RPCInfo pooling may cause panic when RPCInfo is accessed
57- // asynchronously after it has been recycled. Kitex is gradually migrating away
58- // from RPCInfo pooling and will remove this pooling mechanism in the future.
57+ // Deprecated: RPCInfo pooling is a legacy mechanism under migration. It may
58+ // cause panic or data races when RPCInfo is accessed asynchronously after
59+ // framework cleanup. Kitex is gradually removing this pooling mechanism; this
60+ // API is kept only for compatibility during the migration.
5961func EnablePool (enable bool ) {
6062 if enable {
6163 atomic .StoreInt32 (& enablePool , 1 )
@@ -66,9 +68,10 @@ func EnablePool(enable bool) {
6668
6769// PoolEnabled returns true if rpcInfoPool is enabled.
6870//
69- // Deprecated: RPCInfo pooling may cause panic when RPCInfo is accessed
70- // asynchronously after it has been recycled. Kitex is gradually migrating away
71- // from RPCInfo pooling and will remove this pooling mechanism in the future.
71+ // Deprecated: RPCInfo pooling is a legacy mechanism under migration. It may
72+ // cause panic or data races when RPCInfo is accessed asynchronously after
73+ // framework cleanup. Kitex is gradually removing this pooling mechanism; this
74+ // API is kept only for compatibility during the migration.
7275func PoolEnabled () bool {
7376 return atomic .LoadInt32 (& enablePool ) == 1
7477}
@@ -106,9 +109,11 @@ func (r *rpcInfo) zero() {
106109
107110// Recycle reuses the rpcInfo.
108111//
109- // Deprecated: RPCInfo recycling may cause panic when RPCInfo is accessed
110- // asynchronously after it has been recycled. Kitex is gradually migrating away
111- // from RPCInfo pooling and will remove this pooling mechanism in the future.
112+ // Deprecated: RPCInfo recycling is part of the legacy RPCInfo pooling mechanism
113+ // under migration. It may cause panic or data races when RPCInfo is accessed
114+ // asynchronously after framework cleanup. Kitex is gradually removing this
115+ // pooling mechanism; this method is kept only for compatibility during the
116+ // migration.
112117func (r * rpcInfo ) Recycle () {
113118 if ! PoolEnabled () {
114119 return
0 commit comments