Closed durban closed 12 months ago
The scaladoc of Hotswap#get says that "The returned resource is guaranteed to be available for the duration of the returned resource". I don't think this is true: if the whole Hotswap is finalized, the "returned resource" will be finalized too (here: https://github.com/typelevel/cats-effect/blob/a6c5b155be3b729af49eb26204e101f2d527fa80/std/shared/src/main/scala/cats/effect/std/Hotswap.scala#L116).
Hotswap#get
Hotswap
I think either the scaladoc or the implementation should be changed. (Probably the scaladoc, although I've never used Hotswap.)
Thanks, that's actually a bug. We should make sure to acquire an exclusive lock before finalizing.
Fixed by #3841.
The scaladoc of
Hotswap#get
says that "The returned resource is guaranteed to be available for the duration of the returned resource". I don't think this is true: if the wholeHotswap
is finalized, the "returned resource" will be finalized too (here: https://github.com/typelevel/cats-effect/blob/a6c5b155be3b729af49eb26204e101f2d527fa80/std/shared/src/main/scala/cats/effect/std/Hotswap.scala#L116).I think either the scaladoc or the implementation should be changed. (Probably the scaladoc, although I've never used
Hotswap
.)