Skip to content

Log unexpected TensorFlow Serving gRPC errors #949

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

Merged
merged 2 commits into from
Apr 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions pkg/workloads/cortex/lib/client/tensorflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,15 @@ def get_signature_def(stub):
sigAny.Unpack(signature_def_map)
sigmap = json_format.MessageToDict(signature_def_map)
return sigmap["signatureDef"]
except:
if i > 6:
cx_logger().warn(
"unable to read model metadata - model is still loading, retrying..."
)
except Exception as e:
if isinstance(e, grpc.RpcError) and e.code() == grpc.StatusCode.UNAVAILABLE:
if i > 6: # only start logging this after 30 seconds
cx_logger().warn(
"unable to read model metadata - model is still loading, retrying..."
)
else:
print(e) # unexpected error
cx_logger().warn("unable to read model metadata - retrying...")

time.sleep(5)

Expand Down