Skip to content

Fix potential segmentation fault.#492

Merged
murgatroid99 merged 2 commits intogrpc:grpc@1.14.xfrom
nicolasnoble:channel-unwrap-check
Aug 13, 2018
Merged

Fix potential segmentation fault.#492
murgatroid99 merged 2 commits intogrpc:grpc@1.14.xfrom
nicolasnoble:channel-unwrap-check

Conversation

@nicolasnoble
Copy link
Contributor

Described in #490.

The testcase described there now yields the following error instead of segfaulting:

Error: Cannot call getConnectivityState on a closed Channel
    at Immediate.checkState [as _onImmediate] (/home/pixel/sources/example_for_issue_grpc/node_modules/grpc/src/client.js:723:35)
    at runCallback (timers.js:810:20)
    at tryOnImmediate (timers.js:768:5)
    at processImmediate [as _immediateCallback] (timers.js:745:5)

We may also want to add testcases for this, but let's stop the bleeding first.

@nicolasnoble
Copy link
Contributor Author

I'll be unavailable for a week, feel free to amend this PR if need be, it's editable by maintainers.

The errors thrown by `Channel#getConnectivityState` and `Channel#watchConnectivityState` need to be passed to the callback for `Client#waitForReady`.
@murgatroid99 murgatroid99 merged commit 92f4367 into grpc:grpc@1.14.x Aug 13, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Nov 11, 2018
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