cats-effect icon indicating copy to clipboard operation
cats-effect copied to clipboard

Global runtime installation mechanism not working in Scastie

Open vasilmkd opened this issue 3 years ago • 3 comments

Reported by @oleg-py here.

image

https://scastie.scala-lang.org/gLdvaPQsRpu9Gokfz9D7FA

vasilmkd avatar Mar 24 '21 13:03 vasilmkd

My guess is that Scastie isn't classloader-isolating applications as completely as it should be. Any ideas, @OlegYch?

djspiewak avatar Mar 24 '21 15:03 djspiewak

scastie is just doing sbt run with turbo on the example seems to work with turbo off https://scastie.scala-lang.org/LZX9fcYXSjuaNh1mHswV9Q turbo is supposed to improve run performance by reusing already loaded library jars, but i'm not sure how useful it actually is would be nice if cats could work with it though

OlegYch avatar Mar 24 '21 16:03 OlegYch

Hmm, how exactly does turbo work in this context? This may be something we need to explicitly detect. It would be concerning though if there was any sharing or IORuntime instances across runs.

djspiewak avatar Mar 25 '21 04:03 djspiewak

Tried the scastie with CE v3.4.10 and v3.5.0-RC5. The good news is that it no longer crashes on the second invocation but it does log a warning that the global runtime is already installed. The bad news is that it then proceeds to hang 😅

Update: seems to be hanging here. https://github.com/typelevel/cats-effect/blob/c430fceceee128fdd91a4976c5b67893c607eef1/core/jvm/src/main/scala/cats/effect/IOApp.scala#L442

armanbilge avatar May 06 '23 02:05 armanbilge