You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
kubukoz
changed the title
Outcome lost in several placesExitCase lost in several places
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
Hi!
I noticed that
allocated
is used several times instead ofallocatedCase
. If I got it right, this would mean that theExitCase
that the finalizer of a resource receives will always beExitCase.Succeeded
, even if wrapped in anotherResource.apply
.The relevant spots are:
natchez/modules/mtl/shared/src/main/scala/LocalTrace.scala
Line 39 in d1513b8
natchez/modules/core/shared/src/main/scala/Trace.scala
Line 180 in d1513b8
(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.
The text was updated successfully, but these errors were encountered: