Skip to content

[BUG]: Closed error propagation in Stream parallel map functions #1387

@johnhungerford

Description

@johnhungerford

Version

1.0-RC1+10-2e5d5c39+20250716-0923-SNAPSHOT

Scala Version

3.7.1

Expected Behavior

The following test should pass:

"should propagate Abort[Closed] in f" in run {
    val failure = Closed("fail", summon[Frame])
    val stream  = Stream.init(1 to 4).concat(Stream.init(5 to 8)).concat(Stream.init(9 to 12))
    val stream2 = stream.mapPar(i => if i == 5 then Abort.fail(failure) else i + 1)
    Abort.run(stream2.run).map(res => Result.Failure(failure))
}

Actual Behavior

The test hangs and times out

Steps to Reproduce

Add test to StreamCoreExtensionsTest.scala and run sbt kyo-core/testOnly **StreamCoreExtensionsTest -- -z "should propagate Abort[Closed] in f"

Current Workaround

When using any map*Par* methods, handle Closed errors in the transformation functions (e.g., map them to some other error type and then map back again after)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions