Skip to content

Commit

Permalink
Merge pull request #1750 from murgatroid99/grpc_serialization_errors_…
Browse files Browse the repository at this point in the history
…logging

grpc: Log (de)serialization errors specificially, instead of internal errors in general
  • Loading branch information
murgatroid99 committed Apr 20, 2021
2 parents a5f01fb + 412f9f5 commit 1fb9a3f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
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

0 comments on commit 1fb9a3f

Please sign in to comment.