-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
When I use grpc for datastore_api to get entities in GAE flex, there is no response. #3486
Comments
@getumen At the beginning of your post, you mention using the non-public
|
My understanding is that Datatore Api use
print(c.project) returns my project id in both the local and the GAE flex environment.
I mean it freezes. After |
Thanks for the info. @jonparrott I'm not quite sure how to repro in GAE flex, can we chat over Hangouts? |
I find how to reproduce this issue now. In the local setting, my program work with the following gunicorn.conf.py:
However, my program does not work with the following gunicorn.conf.py
My gunicorn and gevent version are 19.7.1 and 1.2.2, respectively. Now I can use grpc for Datastore API if I do not use gevent. |
#3450 |
Thanks for the update @getumen, unfortunately there is nothing we can do at this time, though you can follow along on grpc/grpc#4629 / voice your concerns there (sorry I can't offer better). For the time being you can use HTTP instead of gRPC by setting the |
@getumen Have you found any workaround? Thanks. |
@dhermes Do you know why it doesn't affect BigQuery? But when we drop in Datastore, it just blocks forever and workers timeout.
Tested on app engine flexible with
|
@zero-master My understanding is that gRPC doesn't work with gevent correctly.
Hoping that the information will be of some help to you. |
@getumen Thanks again :) I was able to reproduce this behavior by running gunicorn locally with gunicorn.cong.py contains
Switching to sync workers just doubled my instance count. I'll be trying my app with gRPC disabled. |
@zero-master BigQuery uses an HTTP transport, so there is no gRPC issue. Most APIs have both HTTP and gRPC support (e.g. Datastore) but some have HTTP only (e.g. BigQuery) and some have gRPC only (e.g. BigTable, Spanner, Firestore). For those that have both @getumen suggestion will work great to avoid gRPC. |
From what I understand, the |
@dhermes Thanks you for the details. You just have to get an object from datastore and run gunicorn with "gevent" worker class to successfully reproduce this issue. |
That's great data (as far as making I have never used |
@dhermes Here you go On, step 4 you'll see that it blocks forever but if you use sync worker class by commenting the last line, it will work as expected. |
Has anyone tried this solution? It worked for me from gevent import monkey import grpc.experimental.gevent as grpc_gevent |
This worked perfectly for me to get gevent and either datastore OR spanner working. Thanks! |
Yesterday, I update my project's environment from
vm: true
toenv: flex
and datastore api version from0.22.*
to1.0.0
.In local test, there is no problem and I can fetch entities with
datastore_api=make_datastore_api(self)(google-cloud-python/datastore/google/cloud/datastore/client.py)
However, in GAE flex, when I use grpc for datastore_api to get entities in GAE flex, there is no response.
I can get entities in GAE flex when I use HTTPDatastoreAPI as datastore_api.
How can I use grpc for datastore_api in GAE flex?
Local: Ubuntu 16.04
Cloud: Google App Engine Flexible Environment
python --version
Python 3.5.3
pip show google-cloud
,pip show google-<service>
orpip freeze
No error occur.
I don't know whether this is reproducable.
The text was updated successfully, but these errors were encountered: