Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Don't call to user code before reconciling Channel state. #310

Merged
merged 2 commits into from
Apr 12, 2018

Conversation

Lukasa
Copy link
Contributor

@Lukasa Lukasa commented Apr 12, 2018

Motivation:

Callouts to user code allows the user to make calls that re-enter
channel code. In the case of channel closure, we could call out to the
user before the channel knew it was completely closed, which would
trigger a safety assertion (in debug mode) or hit a fatalError
(in release mode).

Modifications:

Reconciled channel state before we call out to user code.
Added a test for this case.

Result:

Fewer crashes, better channel state management.

Resolves #307.

Motivation:

Callouts to user code allows the user to make calls that re-enter
channel code. In the case of channel closure, we could call out to the
user before the channel knew it was completely closed, which would
trigger a safety assertion (in debug mode) or hit a fatalError
(in release mode).

Modifications:

Reconciled channel state before we call out to user code.
Added a test for this case.

Result:

Fewer crashes, better channel state management.
@Lukasa Lukasa added the 🔨 semver/patch No public API change. label Apr 12, 2018
@Lukasa Lukasa added this to the 1.4.2 milestone Apr 12, 2018
@Lukasa Lukasa requested review from normanmaurer and weissi April 12, 2018 11:32
Copy link
Member

@weissi weissi left a comment

Choose a reason for hiding this comment

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

nice one, thanks

@Lukasa Lukasa merged commit 3275ff7 into apple:master Apr 12, 2018
@Lukasa Lukasa deleted the cb-fix-307 branch April 12, 2018 12:51
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assert hit on TCP RST with full write buffer.
3 participants