I have a task that runs written in Mono, however sometimes (randomly) the Mono runtime will hang after the task is complete and just print:
_wapi_handle_ref: Attempting to ref unused handle 0x2828
_wapi_handle_unref_full: Attempting to unref unused handle 0x2828
_wapi_handle_ref: Attempting to ref unused handle 0x2828
_wapi_handle_unref_full: Attempting to unref unused handle 0x2828
...
to stderr forever. Is there a way of parsing stderr and killing the task when a certain pattern is matched?
A timeout is out of the question because the task can legitimately take upwards of an hour to complete normally, but if there is no work to be done will exit instantly (or at least it's supposed to).