Artifacts Associated With Ticket 39bb9b3ebb
Ticket change [db9d293045] (rid 143874) by aspect on 2015-11-11 04:29:36:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
When a coroutine is deleted by [rename] or through deletion of its namespace, finally handlers are not invoked: % coroutine foo try yield finally {puts ok} % rename foo {} % namespace eval foo { coroutine foo try yield finally {puts ok} } % namespace delete foo Delete traces do fire, providing a sort of workaround: % coroutine foo apply {{{t 0}} { trace add variable t unset {puts ok; list} yield }} % rename foo {} ok Arguably this might not be a bug, but it renders [try .. finally] unreliable for resource deletion in the presence of coroutines. Miguel's previous comments from the chat: 2015-08-09: <aspect> % coroutine c try yield finally {puts ok}; rename c {} ;# no output <aspect> that makes deleting coroutines .. problematic <aspect> delete traces fire though: <aspect> % coroutine c apply {{{t 0}} {trace add variable t unset {puts ok; list}; yield}}; rename c {} ;# emits "ok" <miguel> what is problemtic about deleting coroutines? <miguel> they self-delete when they return; you can delete them as normal commands otherwise - even from within <miguel> ohhh ... the finally never executed, right ... will look into it <miguel> (possibly a problem also for [interp cancel], as they share the mechanism iirc) <miguel> it is a fundamental problem - the classic invincible-force vs unmovable-object: "cancel everything no matter what" vs "before canceling you HAVE to do this one thing (which may require infinite resources)" <miguel> (at least in the [interp cancel] version) <miguel> % try {interp cancel -unwind} finally {puts ok} <miguel> eval unwound * miguel finds this not trivial at all <miguel> the problem is that the finally clause WILL get executed RIGHT AFTER the try clause finishes - which happens to be NEVER in aspect's setup 2015-11-11: <miguel> I have a vague recollection that we talked about it, and that I thought 'not a bug' ... <miguel> ... finally meaning 'before this command returns', and your ops making sure that the command in question never returned ... <miguel> ... so that 'never' satisfies 'before the command returns' - foundin initialized to: "8.6.4"
- is_private initialized to: "0"
- login: "aspect"
- priority initialized to: "5 Medium"
- private_contact initialized to: "a0e4455685fad6d7c7fc63ae05f16454df49fdf3"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "aspect"
- subsystem initialized to: "60. NRE and coroutines"
- title initialized to:
deleting a coroutine bypasses try..finally handlers
- type initialized to: "Bug"