Skip to content

Better Disconnecting Pathway for Dragon Python Client #18

Description

@MattToast

Currently, the only way to disconnect a DragonClient from the python side is to del it directly. This is problematic in the for the following common pattern

def main():
    dd = DDict(...)
    client = DragonClient(dd.serialize(), 5)

    # TODO: lots of cool work with the client goes here

    # User (reasonably) did not call `del` on client
    dd.destroy()

because the client, upon going out of scope, will try to disconnect from the (now destroyed) DDict. This can lead to problems in the dragon runtime and/or a program hang.

We should find a way to do at least one of the following:

  1. Not send a disconnect message if the DDict is no longer available upon python object deconstruction. This will likely need to be done in the C++ layer as the problem likely exists in that client as well.
  2. Add explicit client.disconnect() semantics. This means that the client will need to throw an error if the user then tries to use a disconnected client as we may not have a way to reconnect depending on backend.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions