Skip to content

tor-chanmgr: fix `get_or_launch` cancellation safety using deferred closure

opara requested to merge opara/arti:remove-pending-on-drop into main

This uses a new Defer (which contains a closure and runs that closure when dropped) to automatically clean up in case the future is dropped, panics, or returns early.

@gabi-250 I think this seems the simplest, hopefully shouldn't be hiding any bugs/deadlocks/etc, and I think covers the future cancellation issues that it needs to. Let me know what you think.

Closes #1716.

Edited by opara

Merge request reports

Loading