Open mautini opened 8 months ago
I found a similar situation when running a CustomContainerTrainingJob
in a Compute Engine VM. Interestingly, it only happens when I let it authenticate using the service account associated with the VM. If I set GOOGLE_APPLICATION_CREDENTIALS
to a credentials file for the same service account it runs fine.
https://github.com/langchain-ai/langchain/issues/15222#issuecomment-1878631787
found similar case when i used this with gemini-pro model and langchain with gevent and flask api was throwing error ,
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: Exception ignored in: <function _ChannelCallState.__del__ at 0x7eff08bd9160>
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: Traceback (most recent call last):
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: File "/opt/engati/faq-semantic-searcher/venv/lib/python3.9/site-packages/grpc/_channel.py", line 1247, in __del__
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: self.channel.close(cygrpc.StatusCode.cancelled,
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: File "src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi", line 515, in grpc._cython.cygrpc.Channel.close
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: File "src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi", line 399, in grpc._cython.cygrpc._close
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: File "src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi", line 420, in grpc._cython.cygrpc._close
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: File "/usr/local/lib/python3.9/threading.py", line 312, in wait
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: waiter.acquire()
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: File "/opt/engati/faq-semantic-searcher/venv/lib/python3.9/site-packages/gevent/thread.py", line 121, in acquire
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: acquired = BoundedSemaphore.acquire(self, blocking, timeout)
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: File "src/gevent/_semaphore.py", line 180, in gevent._gevent_c_semaphore.Semaphore.acquire
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: File "src/gevent/_semaphore.py", line 259, in gevent._gevent_c_semaphore.Semaphore.acquire
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: File "src/gevent/_semaphore.py", line 249, in gevent._gevent_c_semaphore.Semaphore.acquire
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: File "src/gevent/_abstract_linkable.py", line 521, in gevent._gevent_c_abstract_linkable.AbstractLinkable._wait
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: File "src/gevent/_abstract_linkable.py", line 487, in gevent._gevent_c_abstract_linkable.AbstractLinkable._wait_core
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: File "src/gevent/_abstract_linkable.py", line 490, in gevent._gevent_c_abstract_linkable.AbstractLinkable._wait_core
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: File "src/gevent/_abstract_linkable.py", line 442, in gevent._gevent_c_abstract_linkable.AbstractLinkable._AbstractLinkable__wait_to_be_notified
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: File "src/gevent/_abstract_linkable.py", line 451, in gevent._gevent_c_abstract_linkable.AbstractLinkable._switch_to_hub
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: File "src/gevent/_greenlet_primitives.py", line 61, in gevent._gevent_c_greenlet_primitives.SwitchOutGreenletWithLoop.switch
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: File "src/gevent/_greenlet_primitives.py", line 65, in gevent._gevent_c_greenlet_primitives.SwitchOutGreenletWithLoop.switch
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: File "src/gevent/_gevent_c_greenlet_primitives.pxd", line 35, in gevent._gevent_c_greenlet_primitives._greenlet_switch
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: gevent.exceptions.LoopExit: This operation would block forever
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: Hub: <Hub '' at 0x7eff17cece80 epoll default pending=0 ref=0 fileno=6 resolver=<gevent.resolver.thread.Resolver at 0x7efe41976ee0 pool=<ThreadPool at 0x7efe41988640 tasks=0 size=4 maxsize=10 hub=<Hub at 0x7eff17cece80 thread_ident=0x7eff2656e740>>> threadpool=<ThreadPool at 0x7efe41988640 tasks=0 size=4 maxsize=10 hub=<Hub at 0x7eff17cece80 thread_ident=0x7eff2656e740>> thread_ident=0x7eff2656e740>
Jan 05 11:23:47 di-appserver11.dev.engati.local bash[17300]: Handles:
i was able to resolve this with using the monkey patching like this mentioned in the pr : https://github.com/grpc/grpc/pull/14561#issue-301487490 , thanks
I try to use Vertex GenAI in a project that also use
gevent
. This project import the gevent lib and performed apatch_all
at the beginning. After thepatch_all
call, the vertex ai lib is not able to load the generative model and hang forever. I tried with several combinations of gevent and vertex and none are actually working.Environment details
python:3.9.16
official docker imagegoogle-cloud-aiplatform
version: 1.26.0 / 1.32.0 / 1.36.0 / 1.36.1Steps to reproduce
gevent
Python lib andgoogle-cloud-aiplatform
monkey.patch_all()
from geventCode example
Stack trace
No Stack trace displayed, it just hang
GRPC trace
When calling
TextGenerationModel.from_pretrained("text-bison")
:After some time I got a timeout and GOAWAY command