Skip to content

Offer a way to free resources in uninterruptible way by default and opt-out ability to interrupt #53

Description

@swamp-agr

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions