Skip to content

fix(gateway): clean up empty session message subscriptions in Subscri… - #648

Closed
Tiktokaiagent wants to merge 1 commit into
use-agent-os:mainfrom
Tiktokaiagent:fix/609-subscription-manager-cleanup
Closed

fix(gateway): clean up empty session message subscriptions in Subscri…#648
Tiktokaiagent wants to merge 1 commit into
use-agent-os:mainfrom
Tiktokaiagent:fix/609-subscription-manager-cleanup

Conversation

@Tiktokaiagent

Copy link
Copy Markdown
Contributor

…ptionManager

The unsubscribe_messages method removed conn_ids from _message_subs sets but never cleaned up the empty set entries, causing a memory leak of empty sets for each session_key that had all subscribers removed.

The remove_connection method had the same issue for _message_subs.

Also added cleanup for _message_subs in remove_connection (previously only _session_subs and _topic_subs were cleaned up properly).

Fixes #609

Linked issue

Fixes #

  • This pull request fully resolves the linked issue, or the description
    says what remains.

Summary

What does this change and why?

Tests

How was this verified? Include the commands you ran and their results.

…ptionManager

The unsubscribe_messages method removed conn_ids from _message_subs
sets but never cleaned up the empty set entries, causing a memory leak
of empty sets for each session_key that had all subscribers removed.

The remove_connection method had the same issue for _message_subs.

Also added cleanup for _message_subs in remove_connection (previously
only _session_subs and _topic_subs were cleaned up properly).

Fixes use-agent-os#609
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: SubscriptionManager._message_subs leaks empty sets on message unsubscription and connection teardown

1 participant