Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Forbid creating new channels after TCP shutdown. #37

Merged
merged 1 commit into from
Aug 14, 2020
Merged

Forbid creating new channels after TCP shutdown. #37

merged 1 commit into from
Aug 14, 2020

Conversation

Lukasa
Copy link
Collaborator

@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 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