Skip to content

Combination of groupBy and mapAsync involving access to the group causes deadlock. #125

@voroninp

Description

@voroninp

Description

My code deadlocks when working with AsyncSeq pipeline.

Repro steps

Code example:

[1;2;3] 
|> AsyncSeq.ofSeq 
|> AsyncSeq.groupBy (fun x -> x) 
|> AsyncSeq.mapAsync (fun (key, gr) -> async {
    let! length = AsyncSeq.length gr
    return (key, length)
})
|> AsyncSeq.toBlockingSeq

Expected behavior

No deadlock, or some xml-doc remarks with the warnings of such possibility, if this is by design.

Known workarounds

It looks like I have to eagerly enumerate the sequence, so all groups get resolved

Related information

  • Operating system Win 10
  • .NET Runtime: 5.0.100

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