Skip to content

have trouble to use D grpc client to talk to Python grpc server #15

@mw66

Description

@mw66

Hi,

I'm trying the helloworld example, but I'm using a Python server, something like this:

import grpc
import HW_pb2
import HW_pb2_grpc

if __name__ == "__main__":
  handler = HWHandler()
  server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
  HW_pb2_grpc.add_HWServicer_to_server(handler, server)
  server.add_insecure_port('[::]:' + str(PORT))
  server.start()

And then use the D grpc client talk to it, the 1st time I run it: I got:

Thread 11 "" received signal SIGSEGV, Segmentation fault.                
[Switching to Thread 0x7fffcf7fe700 (LWP 2892)]                                                                
0x0000555555aca53c in _D4hunt4http6client18Http1ClientDecoderQu6decodeMFCQBx2io10ByteBufferQmCQCs3net10ConnectionQmZv (warning: (Internal error: pc 0x555
555a69009 in read in psymtab, but not in symtab.)                                  
                                                                                                                                                        
warning: (Internal error: pc 0x555555a68fa0 in read in psymtab, but not in symtab.)
                                                                                   
warning: (Internal error: pc 0x555555a69009 in read in psymtab, but not in symtab.)                                                                      
                                                                                                                                                         
warning: (Internal error: pc 0x555555a69009 in read in psymtab, but not in symtab.)
                                                                                                                                                         
this=0x7fffec8589c0, warning: (Internal error: pc 0x555555a69009 in read in psymtab, but not in symtab.)
                                                                                                                                                         
                                                                                                                                       
buffer=0x7fffeccd3e40, warning: (Internal error: pc 0x555555a69009 in read in psymtab, but not in symtab.)                                               
                                                                                   
session=0x7fffecd36690) at Http1ClientDecoder.d:44                                                                           
44                  throw new IllegalStateException("Client connection is null! The actual type is: "                

The 2nd time:

grpc.GrpcException.GrpcTimeoutException@/home//.dub/packages/grpc-0.3.0-beta.4/grpc/source/grpc/GrpcStream.d(225): Timedout after 5 seconds.
----------------                                                                      
??:? [0x555555d64775]
??:? [0x555555d8c9f6]
??:? [0x555555d7056d]
/home//.dub/packages/grpc-0.3.0-beta.4/grpc/source/grpc/GrpcStream.d:225 [0x55555574a6cb]

Since it's a very simple grpc server, before I investigate further, I want to ask: does this D library's grpc client can talk to a Python grpc server?

The Python side grpc code are generated with:

python -m grpc_tools.protoc -I...

with vesion:

grpcio                             1.31.0    
grpcio-tools                       1.31.0    
protobuf                           3.13.0    

If you know these 2 can work together, can you provide a Python grpc server example? and with the specific Python package version?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions