222twotwotwo opened a new pull request, #142: URL: https://github.com/apache/dubbo-getty/pull/142
<!-- Thanks for sending a pull request! --> **What this PR does**: Prevents client shutdown from deadlocking or hanging when session teardown can trigger reconnect logic. This PR: - closes client sessions outside the client map lock by snapshotting `ssMap` during shutdown - introduces `runReconnect()` to start reconnect loops only while the client is open and track them with the client `WaitGroup` - routes session-triggered reconnect through `runReconnect()` instead of synchronously calling `reConnect()` - ensures reconnect backoff is cancelled by `Client.Close()` - adds regression coverage for shutdown/reconnect interleavings, backoff cancellation, and no-op reconnect after close **Which issue(s) this PR fixes**: <!-- *Automatically closes linked issue when PR is merged. Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. _If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_* --> Fixes #132 **Special notes for your reviewer**: The branch has been merged with the latest `origin/master` Additional tests cover: - session error triggering reconnect while `Client.Close()` is running - `Client.Close()` cancelling reconnect backoff - `runReconnect()` becoming a no-op after client shutdown - `Client.Close()` waiting for an in-flight session-triggered reconnect **Does this PR introduce a user-facing change?**: <!-- If no, just write "NONE" in the release-note block below. If yes, a release note is required: Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required". --> ```release-note NONE ``` -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
