Skip to content

Fix incorrect cleanup of binary topics in remove_message_handler() #54

@deannaspinks

Description

@deannaspinks

Summary

remove_message_handler() deletes from _message_handlers_wildcard_topics when cleaning up a binary topic, causing a KeyError and leaving _message_handlers_binary_topics in an inconsistent state.

Location

ProcessImplementation.remove_message_handler() (process.py, ~line 228)

Impact

Removing the last handler for a binary, non-wildcard topic raises a KeyError and may leak entries in _message_handlers_binary_topics.

Expected behaviour

Cleanup should mirror add_message_handler() and delete from _message_handlers_binary_topics when applicable.

Fix

One-line change: delete from _message_handlers_binary_topics instead of _message_handlers_wildcard_topics.
I'll submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions