f1amingo opened a new pull request, #1492:
URL: https://github.com/apache/rocketmq-clients/pull/1492

   ### Summary
   
   `startup()` awaits the first server-pushed Settings command with no bound. 
If the remote never sends one, the promise stays pending forever — the caller 
gets no notification and, worse, the route/settings/heartbeat timers started 
before the await keep running on an instance the caller is about to abandon 
(instance + heartbeat leak). Java does not have this hang: 
`PushConsumerImpl#startUp` wraps the whole flow and on any failure calls 
`shutDown()` before rethrowing, so the caller always learns the outcome and no 
resource is left behind.
   
   The bound is a private internal constant (30s) — no public API surface 
change (no new options, methods or exports), so it can be retuned freely in 
future releases without compatibility concerns.
   
   ### Changes
   
   - BaseClient: bound the wait for the first server-pushed Settings command 
with an internal 30s limit; on timeout — or any other startup failure — run the 
full shutdown cleanup (timers, telemetry sessions, RPC manager) before 
rejecting, mirroring Java's `shutDown(); throw t;` pattern
   - PushConsumer: a startup failure now runs the full shutdown instead of only 
clearing the scan timer
   - Extend `BaseClient.test.ts` with both directions: settings never arrive → 
startup rejects within the timeout and releases resources; settings arrive in 
time → startup resolves and the cleanup path is not triggered
   
   ### How Did You Test This Change?
   
   - New unit tests pass; a dist-level harness exercising both builds shows 
`{"settled":"hung","closeCount":0}` pre-fix vs 
`{"settled":"rejected","closeCount":1}` post-fix, and the success path exits 
naturally with no dangling handles
   - `tsc` build and `eslint` clean (no new warnings)
   


-- 
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