Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExitCase lost in several places #980

Closed
kubukoz opened this issue Mar 14, 2024 · 1 comment · Fixed by #981
Closed

ExitCase lost in several places #980

kubukoz opened this issue Mar 14, 2024 · 1 comment · Fixed by #981

Comments

@kubukoz
Copy link
Member

kubukoz commented Mar 14, 2024

Hi!

I noticed that allocated is used several times instead of allocatedCase. If I got it right, this would mean that the ExitCase that the finalizer of a resource receives will always be ExitCase.Succeeded, even if wrapped in another Resource.apply.

The relevant spots are:

t.span(name, options).allocated.map { case (child, release) =>

span.span(name, options).allocated.map { case (child, release) =>

(there are actually more in that file)

I believe for a correct implementation these should be replaced with the case-aware variants. Otherwise, the resources being wrapped will never be closed with a Canceled/Errored exit.

@kubukoz kubukoz changed the title Outcome lost in several places ExitCase lost in several places Mar 14, 2024
@kubukoz
Copy link
Member Author

kubukoz commented Mar 14, 2024

I suppose the code was written back in the day of CE2, when we didn't have allocatedCase. Also, instead of Resource.apply we should probably be using applyFull and wrapping the underlying resource in cancelable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant