Follow-up to #34.
Since 0.5.0.0 the resource pool has changed its behaviour: resource-freeing function runs under regular interruptible mask_ instead of uninterruptibleMask_ as before. That leads to situations where asynchronous exceptions could interrupt free in the middle of a blocking cleanup (e.g. closing a handle/network socket) leading to resource never being released and the actual leakage.
We have tried to perform an upgrade of one of the resource-pool consumer packages and stumbled upon a few leakage leading to following situations:
See minimal reproducible cases attached to those issues (they are all similar).
Proposed solution would be to change free in such a way to pass releasing function as argument, that way consumer or end user would be reminded to handle resource destruction explicitly. Or extend pool configuration with a flag that indicates how to handle pool resource destroying. What do you think?
Follow-up to #34.
Since
0.5.0.0the resource pool has changed its behaviour: resource-freeing function runs under regular interruptiblemask_instead ofuninterruptibleMask_as before. That leads to situations where asynchronous exceptions could interruptfreein the middle of a blocking cleanup (e.g. closing a handle/network socket) leading to resource never being released and the actual leakage.We have tried to perform an upgrade of one of the resource-pool consumer packages and stumbled upon a few leakage leading to following situations:
See minimal reproducible cases attached to those issues (they are all similar).
Proposed solution would be to change
freein such a way to pass releasing function as argument, that way consumer or end user would be reminded to handle resource destruction explicitly. Or extend pool configuration with a flag that indicates how to handle pool resource destroying. What do you think?