RockteMQ-AI commented on issue #1403:
URL: 
https://github.com/apache/rocketmq-clients/issues/1403#issuecomment-6281657255

   **Issue Evaluation**
   
   Category: `type/bug` | Status: **Confirmed**
   
   Thank you for the detailed report. The issues have been verified against the 
Rust client codebase.
   
   ## Verification Results
   
   ### 1. session_map memory leak — **Confirmed**
   - `rust/src/client.rs:869` — `session_map` is a `HashMap<String, Session>` 
with no eviction logic
   - `rust/src/client.rs:883-900` — `get_or_create_session` only inserts, never 
removes dead sessions
   - `rust/src/client.rs:910-916` — the only removal path is `shutdown()` → 
`clear()`. Sessions accumulate permanently.
   
   ### 2. Telemetry stream reconstruction — **Confirmed**
   - `rust/src/client.rs:206-207` — `sync_settings_interval` fires every 30s
   - `rust/src/client.rs:244-257` — the loop calls `update_settings` on shadow 
sessions (clones, not originals)
   - `rust/src/session.rs:405-413` — the shadow's telemetry stream is created 
but immediately dropped when the shadow goes out of scope, causing the one-off 
stream pattern every 30s
   
   ### 3. No HTTP/2 keepalive — **Confirmed**
   - `rust/src/session.rs:204-227` — `build_endpoint` only configures 
`connect_timeout` and `tcp_nodelay`. No `http2_keep_alive_interval`, 
`keep_alive_timeout`, or `keep_alive_while_idle` are set.
   
   ### 4. Dead endpoint accumulation — **Confirmed**
   - Dead sessions are never removed and both heartbeat and sync-settings loops 
iterate all sessions every 30s, logging errors for each dead one
   - `rust/src/client.rs:891-892` returns dead sessions for all RPCs without 
checking liveness
   
   ### 5. gRPC deadline mismatch — **Confirmed (doc/code mismatch)**
   - `rust/src/conf.rs:94` — documentation states receive timeout = 
`long_polling_timeout` + `timeout`
   - `rust/src/session.rs:499` — actual code uses only `long_polling_timeout` 
as the deadline, with zero margin
   
   ### 6. Server-pushed Settings discarded — **Confirmed (partial)**
   - `rust/src/simple_consumer.rs:104-106` — all telemetry commands are logged 
and dropped
   - Other consumers only handle specific fields, discarding the rest
   
   ## Root Cause
   
   The core issue is the lack of session lifecycle management. The 
`session_map` grows unboundedly, shadow sessions are used for telemetry updates 
but immediately dropped, and there is no HTTP/2 keepalive to detect dead 
connections.
   
   ## Next Steps
   
   An automated fix proposal will be generated. Reply `/approve` to proceed 
with PR generation.
   
   ---
   *Automated evaluation by github-manager-bot*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to