google-cloud-python icon indicating copy to clipboard operation
google-cloud-python copied to clipboard

Add support for HTTP Transport for google-cloud-monitoring

Open courteouselk opened this issue 5 years ago • 2 comments

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Is your feature request related to a problem? Please describe.

We are experiencing a problem with using python's multiprocessing (fork) together with google-cloud-monitoring library. This library uses gRPC that has problems with forking of the process. We had been observing things like hanging, deadlocks, memory corruption due to that. Eventually, we had to disable gRPC via GOOGLE_CLOUD_DISABLE_GRPC environment variable which did the thing for the logging library, but did not for the monitoring.

Describe the solution you'd like

Therefore, we would like to file a feature request that would enable alternative transports (e.g. HTTP) for the monitoring library.

courteouselk avatar Jan 06 '21 15:01 courteouselk

Hi @courteouselk,

There is a HTTP transport that is in progress for the generated Python clients. We expect it to roll out to the libraries sometime this year. You can see https://github.com/googleapis/gapic-generator-python/issues/267 for status.

Just in case, here is the note in our docs about multiprocessing:

Because this client uses grpcio library, it is safe to share instances across threads. In multiprocessing scenarios, the best practice is to create client instances after the invocation of os.fork() by multiprocessing.Pool or multiprocessing.Process.

busunkim96 avatar Jan 06 '21 15:01 busunkim96

This feature request is still outstanding. It should be completed this year.

I'm going to transfer this issue to the google-cloud-python repository as we are preparing to move the code for google-cloud-monitoring to that repository in the next 1-2 weeks.

parthea avatar Apr 18 '23 14:04 parthea