4

Is there a way in gcloud-python to close a connection? Currently, it seems that a connection is established and once it's done, it will sit there in CLOSE_WAIT and time out eventually. Any help is appreciated. Thanks!

Background: I have a server running that will open a new connection when a POST request comes in that writes to GCS. When looking at a netstat, there are ~ 40 connections (all to google) that are in CLOSE_WAIT.

Edit: I have looked through the docs and nothing seems to jump out at me

bossylobster
  • 9,993
  • 1
  • 42
  • 61
hangryzone
  • 79
  • 6

1 Answers1

0

It looks one can manually close the connection using client.channel.close() or client._channel.close() see here, but that it only closes the connection made through gRPC, not the connections gcloud-python opens via requests here.

I couldn't find much luck in fixing this issue using gcloud-python, but found success when using subprocess to call gsutil.

Don't know if that's an option for you, but let it be known that I've also struggling with this for the past couple while too! So hopefully after 2 years you've found reprieve or swept this issue under the rug :p

camen
  • 1
  • 1