Skip to content

Conversation

@twittemb
Copy link
Contributor

@twittemb twittemb commented Apr 20, 2022

This PR is the sister from this one #143 but for AsyncThrowingChannel that suffers from the very same issue.

The issue is described here: #142

Before this PR, an AsyncThrowingChannel could crash in the following context:

  • start an iteration in a Task
  • cancel the task while the AsyncThrowingChannel is being awaited
  • send a value in the channel

An issue has already been created to track the implementation of unit tests to ensure non regression: #148

This commit fixes crashes where the state is "awaiting" with no more awaiting clients.
The state is now set to .idle to reflect the reality.
Copy link
Member

@phausler phausler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, same fix, same previous caveat that we need to follow up with some way of validating this in tests; looks right to me.

@phausler phausler merged commit 6d5d631 into apple:main Apr 21, 2022
@twittemb twittemb deleted the fix/asyncThrowingChannel-awaiting branch May 4, 2022 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants