Closed mperucca closed 4 months ago
Thanks for reporting! Note that we've got a significant rewrite of Dispatcher
in flight which should hopefully fix this and many other bugs (but I have not verified this yet).
Wow this is amazing. I don't have any intuition about how this is happening, and I kinda don't want to. :P The rewrite definitely doesn't have this issue.
This might be specific to
unsafeToFuture
, but closing aDispatcher
runs all queued tasks and does so concurrently, which was even more alarming forsequential
, as seen below.A test case in my code that initially hinted at this unexpected behavior was the following:
3.4.8 is the last version that behaves as expected.
This seems similar to https://github.com/typelevel/cats-effect/issues/3945, but the problem seemed to go farther back, possibly to https://github.com/typelevel/cats-effect/pull/3510.