google / turbinia

Automation and Scaling of Digital Forensics Tools
Apache License 2.0
750 stars 162 forks source link

Turbinia client hangs when revoking GCP credentials #885

Closed hacktobeer closed 5 months ago

hacktobeer commented 3 years ago

When revoking GCP credentials ($ gcloud auth revoke) the client library hang for 600 seconds trying to call the create_topic() code below: https://github.com/google/turbinia/blob/master/turbinia/pubsub.py#L68

Should we set a retry and timeout object when creating the PublisherClient to minimise the time the user has to wait? https://googleapis.dev/python/pubsub/latest/UPGRADING.html#custom-retry-and-timeout-settings-for-publisher-client

tomchop commented 3 years ago

FWIW, I tried

from google.api_core.timeout  import ConstantTimeout
# ...
self.publisher.create_topic(self.topic_path, timeout=ConstantTimeout(timeout=10))

And that didn't change the behavior

aarontp commented 3 years ago

What's the use-case or steps to reproduce this here? Is this when revoking, re-auth'ing and then re-running turbiniactl?

hacktobeer commented 3 years ago

Do a request and fetch the results with the wait option, go to another terminal and revoke the gcloud credentials, which makes the turbinia client hang. It would be nice to see if it's possible to do some error checking in the wait function or be able to set a timeout.

jleaniz commented 5 months ago

Closing this since the old client is deprecated.