Persona destruction semantics are incomplete

Issue #86 resolved
Amir Kamil created an issue

Specifically, what happens if there are LPCs enqueued on the persona when it is destroyed? Is this legal, and if so, does are the LPCs run by the destructor?

Comments (3)

  1. Dan Bonachea

    New persona destructor added by Amir in f89f055:

    Destructs this persona object. Operations that are currently enqueued on this persona are discarded.

    Are we sure we want to provide this drop-it-on-the-floor semantics? Is there a motivation to provide that guarantee?

    In particular, if the persona has incoming lpc's enqueued that were sent via persona::lpc(), the initiator now has a future, associated promise, and possibly a chain of cascaded futures that can never be fulfilled and are essentially permanently leaked. Similar problems if the destroyed persona initiated some RMA that is still in-flight or awaiting a call to progress for notification - in that case the memory covered by the RMA is also effectively unusable for the remainder of the job. Finally, it raises the semantic question of whether those "discarded" operations constitute "in-flight" operations that technically violate quiescence and prevent well-defined calls to finalize() for the rest of the job.

    I think we could avoid all this by specifying that destroying a persona that is not fully quiesced (ie no outgoing or incoming operations in flight) has undefined behavior.

    Additionally, I think we may also want to state that destroying a persona while it is part of a live persona_scope implies UB.

  2. Log in to comment