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:
- 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.
- 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.
Currently, the only way to disconnect a
DragonClientfrom the python side is todelit directly. This is problematic in the for the following common patternbecause 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:
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.