Hi all,

I was trying to launch a GRPC server within an ryu app to talk to my on-switch 
client. The code for launching the server is as follows:

server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
xx_service_pb2_grpc.add_XXServicer_to_server(XXServicer(), server)
server.add_insecure_port('[::]:50050')
server.start()

The server class is minimal with only one function printing out client messages 
right now

I tried to put this piece of code in start(), __init__() or even outside the 
methods, but they all block at server.start(). Normally(such as when running 
this code in a standalone python app) this piece of code will just finish right 
away without blocking. When blocked, pressing ctrl-c gets me this:

^CException in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/local/lib/python2.7/dist-packages/grpc/_server.py", line 673, in 
_serve
    event = state.completion_queue.poll()
  File "src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi", line 
114, in grpc._cython.cygrpc.CompletionQueue.poll 
(src/python/grpcio/grpc/_cython/cygrpc.c:10482)
KeyboardInterrupt

Apparently the code is stuck at the poll(). I am guessing this has something to 
do with the threading.

Any input will be welcome, or experience with running GRPC servers alongside 
Ryu apps, thanks!

Best,
Leonard
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to