Fix Rust connection callback context cleanup and add regression test
Description
Closes: #5520
- Clean up connection callback contexts on ShutdownComplete so handlers set via ConnectionRef are freed automatically (no leak).
- Allow connection callbacks to return success when the context was already cleared (e.g., post-cleanup), avoiding panics.
- Add a regression test that asserts the server-side ConnectionRef handler is dropped after shutdown. Testing
Testing
- cargo test
Documentation
Is there any documentation impact for this change?
@microsoft-github-policy-service agree
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:warning: Please upload report for BASE (main@b69aa08). Learn more about missing BASE report.
:warning: Report is 19 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #5618 +/- ##
=======================================
Coverage ? 85.05%
=======================================
Files ? 60
Lines ? 18663
Branches ? 0
=======================================
Hits ? 15873
Misses ? 2790
Partials ? 0
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Hi @guhetier! Thanks a lot for the review and approval. Since I don’t have merge permissions, could you please merge this PR when you get a chance? Thank you!
I'll merge as soon as the CI completes (a few unrelated failures). Thanks @LindonAliu for the contribution!