私たちは、分散システムのいずれかでイベントが発生した後、既存のトピックに簡単に公開しようとしています。見るとgoogle.gax.errors.GaxErrorを返すGoogle PubSub:GaxError RPCが原因で失敗しました... StatusCode.UNAVAILABLE
(以下フルエラー)google.gax.errors.GaxError: GaxError(RPC failed, caused by <_Rendezvous of RPC that terminated with (StatusCode.UNAVAILABLE, {"created":"@1478711654.067744009","description":"Secure read failed","file":"src/core/lib/security/transport/secure_endpoint.c","file_line":157,"grpc_status":14,"referenced_errors":[{"created":"@1478711654.067706801","description":"EOF","file":"src/core/lib/iomgr/tcp_posix.c","file_line":235}]})>
を:私たちは除いて、すべてをキャッチし、バックトレースを印刷する場合、我々が得る
try:
dat = data.encode('utf-8')
topic.publish(dat)
except:
<code to recover>
:
コードは次のようになりますhttp://gcloud-python.readthedocs.io/en/latest/pubsub-topic.html#google.cloud.pubsub.topic.Topic.publish、これはGAXエラーのようには見えません。しかし、を実行してエラーをキャッチし、指数バックオフを使用して再試行すると、通常は2回目の動作となります。
私はthis discussionを見つけましたが、_gax_python
の潜在的なエラーとは言いませんが、それは関係していないようです。私たちがここで間違っているかもしれないことについての考え?
全エラー:
458 Traceback (most recent call last):
459 File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
460 self.run()
461 File "/usr/lib/python3.5/threading.py", line 862, in run
462 self._target(*self._args, **self._kwargs)
463 File "/home/pp/pp/pp/process/uploader.py", line 145, in upload_thread
464 topic.publish(byte_string)
465 File "/home/pp/.virtualenvs/cv/lib/python3.5/site-packages/google/cloud/pubsub/topic.py", line 257, in publish
466 message_ids = api.topic_publish(self.full_name, [message_data])
467 File "/home/pp/.virtualenvs/cv/lib/python3.5/site-packages/google/cloud/pubsub/_gax.py", line 165, in topic_publish
468 options=options)
469 File "/home/pp/.virtualenvs/cv/lib/python3.5/site-packages/google/cloud/gapic/pubsub/v1/publisher_api.py", line 289, in publish
470 return self._publish(request, options)
471 File "/home/pp/.virtualenvs/cv/lib/python3.5/site-packages/google/gax/api_callable.py", line 481, in inner
472 return api_caller(api_call, this_settings, request)
473 File "/home/pp/.virtualenvs/cv/lib/python3.5/site-packages/google/gax/api_callable.py", line 158, in inner
474 return a_func(request, **kwargs)
475 File "/home/pp/.virtualenvs/cv/lib/python3.5/site-packages/google/gax/api_callable.py", line 434, in inner
476 errors.create_error('RPC failed', cause=exception))
477 File "/home/pp/.virtualenvs/cv/lib/python3.5/site-packages/future/utils/__init__.py", line 419, in raise_with_traceback
478 raise exc.with_traceback(traceback)
479 File "/home/pp/.virtualenvs/cv/lib/python3.5/site-packages/google/gax/api_callable.py", line 430, in inner
480 return a_func(*args, **kwargs)
481 File "/home/pp/.virtualenvs/cv/lib/python3.5/site-packages/google/gax/api_callable.py", line 64, in inner
482 return a_func(*updated_args, **kwargs)
483 File "/home/pp/.virtualenvs/cv/lib/python3.5/site-packages/grpc/_channel.py", line 481, in __call__
484 return _end_unary_response_blocking(state, False, deadline)
485 File "/home/pp/.virtualenvs/cv/lib/python3.5/site-packages/grpc/_channel.py", line 432, in _end_unary_response_blocking
486 raise _Rendezvous(state, None, None, deadline)
487 google.gax.errors.GaxError: GaxError(RPC failed, caused by <_Rendezvous of RPC that terminated with (StatusCode.UNAVAILABLE, {"created":"@1478711654.067744009","description":"Secure read failed","file":"src/core/lib/security/transport/secure_endpoint.c","file_line":157,"grpc_status":14,"referenced_errors":[{"created":"@1478711654.067706801","description":"EOF","file":"src/core/lib/iomgr/tcp_posix.c","file_line":235}]})>