Skip to content

terminate_zmq() not called on exit - can leave sockets hanging #203

@avinxshKD

Description

@avinxshKD

was looking through the ZMQ code in concore.py and noticed that terminate_zmq() exists but nothing calls it automatically when the script ends. You have to remember to call it yourself.

Some of the example files do call it manually (like in 0mq/firstNode.py) but if someone forgets or the program crashes, the sockets just stay open. Can cause "address already in use" errors when you try to restart.

Simple fix would be registering it with atexit:

import atexit
atexit.register(terminate_zmq)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions