Skip to content

Racing Resource causes exception to be printed in standard error #3086

Description

@lavrov

Reproduction script (scala-cli):

//> using lib "org.typelevel::cats-effect:3.3.13"

import cats.effect.*

object Main extends IOApp.Simple:

  def run =
    Resource
      .eval(IO.raiseError(new Exception("Boom")))
      .race(Resource.never)
      .attempt
      .use(_ => 
        IO.println("Done")
      )

Running scala-cli run main.scala gives the following output:

java.lang.Exception: Boom
	at Main$.run(main.scala:9)
	at run$ @ Main$.run(main.scala:5)
Done

where exception stacktrace comes from standard error.

Activity

  1. armanbilge commented on Jul 10, 2022

    @armanbilge
    Member

    Thanks for reporting. I think this may be related to #2962 and #3085.

  2. armanbilge commented on Dec 21, 2022

    @armanbilge
    Member

    This still seems to be a problem as of 3.4.2. Maybe we can fix it as part of #3226.

  3. djspiewak commented on Feb 27, 2023

    @djspiewak
    Member

    @armanbilge Did we work around this with the specialized race implementation?

  4. armanbilge commented on Feb 27, 2023

    @armanbilge
    Member

    Yup! Tried the reproducer with 3.4.2 and 3.4.3 when the new race implementation landed. The fix happened between there anyway :)

  5. added a commit that references this issue on Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions