Skip to content

AsyncChannel and AsyncThrowingChannel can hang tasks when that task is cancelled #131

@phausler

Description

@phausler
let channel = AsyncChannel<Int>()
let task = Task {
  print("awaiting")
  await channel.send(1)
  print("done sending")
}
try! await Task.sleep(nanoseconds: 1_000_000_000)
task.cancel()
print("cancelled task")

https://forums.swift.org/t/leaking-tasks-if-a-channel-receiver-is-no-longer-listening/56330

Metadata

Metadata

Assignees

Labels

v1.0Work leading up first API stable version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions