Pull#lease
, Pull.bracketCase
and Pull.extendScopeTo
are not cancellation safe.
#3474
Labels
Pull#lease
, Pull.bracketCase
and Pull.extendScopeTo
are not cancellation safe.
#3474
Pull.extendScopeTo
hereA safer variant could be:
The code that can produce the error.
Pull.bracketCase
can be cancelled after theacquire
and duringuse
.I don't know what uses
Pull.bracketCase
has, other thanPull#lease
, but I think it should at least be documented that it shouldn't be used for resources, sincerelease
is not guaranteed.Pull#lease
is subject to the issues ofbracketCase
and can cause resources on the scope to never be released.I think it could be implemented in a safe way using the new
leaseScope
introduced above.Will make the PR, just wanted a discussion first.
The text was updated successfully, but these errors were encountered: