Skip to content

Conversation

@Lukasa
Copy link
Contributor

@Lukasa Lukasa commented Aug 14, 2020

Motivation:

If users attempt to create new stream channels after TCP shutdown, or if
they race with it, they may find that their promises hang forever.
That's an unforgiveable sin in NIO programs: promises must never hang
forever.

Modifications:

  • Add a state tracking flag to work out if we can still create channels.
  • Test that we correctly forbid them after TCP shutdown is received.

Result:

No hanging promises.

Fixes #36.

Motivation:

If users attempt to create new stream channels after TCP shutdown, or if
they race with it, they may find that their promises hang forever.
That's an unforgiveable sin in NIO programs: promises must never hang
forever.

Modifications:

- Add a state tracking flag to work out if we can still create channels.
- Test that we correctly forbid them after TCP shutdown is received.

Result:

No hanging promises.
@Lukasa Lukasa requested a review from artemredkin August 14, 2020 14:21
@Lukasa Lukasa merged commit 5dc9bb7 into apple:main Aug 14, 2020
@Lukasa Lukasa deleted the cb-late-creation branch August 14, 2020 14:34
artemredkin pushed a commit to artemredkin/swift-nio-ssh that referenced this pull request Feb 19, 2021
Motivation:

If users attempt to create new stream channels after TCP shutdown, or if
they race with it, they may find that their promises hang forever.
That's an unforgiveable sin in NIO programs: promises must never hang
forever.

Modifications:

- Add a state tracking flag to work out if we can still create channels.
- Test that we correctly forbid them after TCP shutdown is received.

Result:

No hanging promises.
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.

createChannel on inactive channel is not failed

2 participants