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

grpc: Log (de)serialization errors specificially, instead of internal errors in general #1750

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/grpc-native-core/binding.gyp
Expand Up @@ -91,7 +91,7 @@
'GPR_BACKWARDS_COMPATIBILITY_MODE',
'GRPC_ARES=1',
'GRPC_UV',
'GRPC_NODE_VERSION="1.24.5"',
'GRPC_NODE_VERSION="1.24.7"',
'CARES_STATICLIB',
'CARES_SYMBOL_HIDING'
],
Expand Down
2 changes: 1 addition & 1 deletion packages/grpc-native-core/build.yaml
@@ -1,3 +1,3 @@
settings:
'#': It's possible to have node_version here as a key to override the core's version.
node_version: 1.24.5
node_version: 1.24.7
2 changes: 1 addition & 1 deletion packages/grpc-native-core/package.json
@@ -1,6 +1,6 @@
{
"name": "grpc",
"version": "1.24.6",
"version": "1.24.7",
"author": "Google Inc.",
"description": "gRPC Library for Node",
"homepage": "https://grpc.io/",
Expand Down
8 changes: 5 additions & 3 deletions packages/grpc-native-core/src/server.js
Expand Up @@ -55,9 +55,6 @@ function handleError(call, error) {
if (error.hasOwnProperty('details')) {
status.details = error.details;
}
if (status.code == constants.status.INTERNAL) {
common.log(constants.logVerbosity.ERROR, error);
}
}
if (error.hasOwnProperty('metadata')) {
statusMetadata = error.metadata;
Expand Down Expand Up @@ -97,6 +94,7 @@ function sendUnaryResponse(call, value, serialize, metadata, flags) {
try {
message = serialize(value);
} catch (e) {
common.log(constants.logVerbosity.ERROR, e);
e.code = constants.status.INTERNAL;
handleError(call, e);
return;
Expand Down Expand Up @@ -310,6 +308,7 @@ function _write(chunk, encoding, callback) {
try {
message = this.serialize(chunk);
} catch (e) {
common.log(constants.logVerbosity.ERROR, e);
e.code = constants.status.INTERNAL;
callback(e);
return;
Expand Down Expand Up @@ -400,6 +399,7 @@ function _read(size) {
try {
deserialized = self.deserialize(data);
} catch (e) {
common.log(constants.logVerbosity.ERROR, e);
e.code = constants.status.INTERNAL;
self.emit('error', e);
return;
Expand Down Expand Up @@ -583,6 +583,7 @@ function handleUnary(call, handler, metadata) {
try {
emitter.request = handler.deserialize(result.read);
} catch (e) {
common.log(constants.logVerbosity.ERROR, e);
e.code = constants.status.INTERNAL;
handleError(call, e);
return;
Expand Down Expand Up @@ -635,6 +636,7 @@ function handleServerStreaming(call, handler, metadata) {
try {
stream.request = handler.deserialize(result.read);
} catch (e) {
common.log(constants.logVerbosity.ERROR, e);
e.code = constants.status.INTERNAL;
stream.emit('error', e);
return;
Expand Down
1 change: 0 additions & 1 deletion tools/release/cross/Dockerfile
Expand Up @@ -3,7 +3,6 @@ FROM debian:stretch
RUN dpkg --add-architecture i386
RUN apt-get update
RUN apt-get install -y curl build-essential g++-aarch64-linux-gnu g++-arm-linux-gnueabihf g++-s390x-linux-gnu python libc6-dev:i386 lib32stdc++-6-dev
RUN curl -fsSL get.docker.com | bash

RUN mkdir /usr/local/nvm
ENV NVM_DIR /usr/local/nvm
Expand Down
1 change: 0 additions & 1 deletion tools/release/native/Dockerfile
Expand Up @@ -6,7 +6,6 @@ RUN sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt
RUN apt-get update
RUN apt-get -t jessie-backports install -y cmake
RUN apt-get install -y curl build-essential python libc6-dev-i386 lib32stdc++-4.9-dev jq
RUN curl -fsSL get.docker.com | bash

RUN mkdir /usr/local/nvm
ENV NVM_DIR /usr/local/nvm
Expand Down