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

netty: Eagerly create SslContext #3060

Merged
merged 1 commit into from
Jun 6, 2017
Merged

Conversation

ejona86
Copy link
Member

@ejona86 ejona86 commented Jun 5, 2017

Creating the SslContext can throw, generally due to broken ALPN. We want
that to propagate to the caller of build(), instead of within the
channel where it could easily cause hangs.

We still delay creation until actual build() time, since TLS is not
guaranteed to work and the application may be configuring plaintext or
similar later before calling build() where SslContext is unnecessary.

The only externally-visible change should be the exception handling.
I'd add a test, but the things throwing are static and trying to inject
them would be pretty messy.

Fixes #2599

Creating the SslContext can throw, generally due to broken ALPN. We want
that to propagate to the caller of build(), instead of within the
channel where it could easily cause hangs.

We still delay creation until actual build() time, since TLS is not
guaranteed to work and the application may be configuring plaintext or
similar later before calling build() where SslContext is unnecessary.

The only externally-visible change should be the exception handling.
I'd add a test, but the things throwing are static and trying to inject
them would be pretty messy.

Fixes grpc#2599
@ejona86 ejona86 force-pushed the nohang-on-broken-tls branch from 1c0f826 to 29e5592 Compare June 5, 2017 21:45
@ejona86 ejona86 added the TODO:backport PR needs to be backported. Removed after backport complete label Jun 5, 2017
Copy link
Contributor

@carl-mastrangelo carl-mastrangelo left a comment

Choose a reason for hiding this comment

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

LGTM

@ejona86 ejona86 merged commit c48610b into grpc:master Jun 6, 2017
@ejona86 ejona86 deleted the nohang-on-broken-tls branch June 6, 2017 19:00
@ejona86 ejona86 removed the TODO:backport PR needs to be backported. Removed after backport complete label Jun 6, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants