Skip to content

netty: Eagerly create SslContext - #3060

Merged
ejona86 merged 1 commit into
grpc:masterfrom
ejona86:nohang-on-broken-tls
Jun 6, 2017
Merged

ejona86 merged 1 commit into
grpc:masterfrom
ejona86:nohang-on-broken-tls

Conversation

@ejona86

@ejona86 ejona86 commented Jun 5, 2017 •

Copy link
Copy Markdown
Member

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

@carl-mastrangelo carl-mastrangelo left a comment

Copy link
Copy Markdown
Contributor

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