Skip to content

Conversation

@kartheek-hc
Copy link
Contributor

@kartheek-hc kartheek-hc commented Jan 15, 2026

Description

  • The example under grpc is meant to serve plugins over both net/rpc and gRPC, however it is only supporting the GRPCPlugin since the plugin name is hardcoded
  • The Python plugin implementation in the same example is writing bytes as is in the Put method and the file it creates looks like
    b'world'
    
    Written from plugin-python
    

Related Issue

N/A

How Has This Been Tested?

  1. Verify that the netrpc based plugin works as expected
    $ KV_PROTO=netrpc KV_PLUGIN=./kv-go-netrpc ./kv put hello world
    2026-01-16T04:12:39.785+0530 [DEBUG] plugin: starting plugin: path=/bin/sh args=["sh", "-c", "./kv-go-netrpc"]
    2026-01-16T04:12:39.786+0530 [DEBUG] plugin: plugin started: path=/bin/sh pid=86840
    2026-01-16T04:12:39.786+0530 [DEBUG] plugin: waiting for RPC address: plugin=/bin/sh
    2026-01-16T04:12:39.834+0530 [DEBUG] plugin: using plugin: version=1
    2026-01-16T04:12:39.834+0530 [DEBUG] plugin.sh: plugin address: address=/var/folders/f0/3m5x22012pl_kcwgrv1xn16m0000gn/T/plugin1603026947 network=unix timestamp="2026-01-16T04:12:39.834+0530"
    2026-01-16T04:12:39.837+0530 [DEBUG] plugin.sh: 2026/01/16 04:12:39 [ERR] plugin: stream copy 'stderr' error: stream closed
    2026-01-16T04:12:39.837+0530 [DEBUG] plugin.sh: 2026/01/16 04:12:39 [DEBUG] plugin: plugin server: accept unix /var/folders/f0/3m5x22012pl_kcwgrv1xn16m0000gn/T/plugin1603026947: use of closed network connection
    2026-01-16T04:12:39.838+0530 [INFO]  plugin: plugin process exited: plugin=/bin/sh id=86840
    2026-01-16T04:12:39.838+0530 [DEBUG] plugin: plugin exited
    
    $ KV_PROTO=netrpc KV_PLUGIN=./kv-go-netrpc ./kv get hello
    2026-01-16T04:12:43.248+0530 [DEBUG] plugin: starting plugin: path=/bin/sh args=["sh", "-c", "./kv-go-netrpc"]
    2026-01-16T04:12:43.249+0530 [DEBUG] plugin: plugin started: path=/bin/sh pid=86951
    2026-01-16T04:12:43.249+0530 [DEBUG] plugin: waiting for RPC address: plugin=/bin/sh
    2026-01-16T04:12:43.278+0530 [DEBUG] plugin: using plugin: version=1
    2026-01-16T04:12:43.278+0530 [DEBUG] plugin.sh: plugin address: address=/var/folders/f0/3m5x22012pl_kcwgrv1xn16m0000gn/T/plugin3283603273 network=unix timestamp="2026-01-16T04:12:43.278+0530"
    world
    
    Written from plugin-go-netrpc
    2026-01-16T04:12:43.279+0530 [DEBUG] plugin.sh: 2026/01/16 04:12:43 [DEBUG] plugin: plugin server: accept unix /var/folders/f0/3m5x22012pl_kcwgrv1xn16m0000gn/T/plugin3283603273: use of closed network connection
    2026-01-16T04:12:43.279+0530 [INFO]  plugin: plugin process exited: plugin=/bin/sh id=86951
    2026-01-16T04:12:43.279+0530 [DEBUG] plugin: plugin exited
    
  2. Verify the gRPC based Go plugin works as expected
    $ KV_PROTO=grpc KV_PLUGIN=./kv-go-grpc ./kv put hello world
    2026-01-16T04:14:04.277+0530 [DEBUG] plugin: starting plugin: path=/bin/sh args=["sh", "-c", "./kv-go-grpc"]
    2026-01-16T04:14:04.279+0530 [DEBUG] plugin: plugin started: path=/bin/sh pid=87786
    2026-01-16T04:14:04.279+0530 [DEBUG] plugin: waiting for RPC address: plugin=/bin/sh
    2026-01-16T04:14:05.703+0530 [DEBUG] plugin: using plugin: version=1
    2026-01-16T04:14:05.703+0530 [DEBUG] plugin.sh: plugin address: address=/var/folders/f0/3m5x22012pl_kcwgrv1xn16m0000gn/T/plugin937069144 network=unix timestamp="2026-01-16T04:14:05.702+0530"
    2026-01-16T04:14:05.704+0530 [TRACE] plugin.stdio: waiting for stdio data
    2026-01-16T04:14:05.706+0530 [DEBUG] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
    2026-01-16T04:14:05.707+0530 [INFO]  plugin: plugin process exited: plugin=/bin/sh id=87786
    2026-01-16T04:14:05.707+0530 [DEBUG] plugin: plugin exited
    
    $ KV_PROTO=grpc KV_PLUGIN=./kv-go-grpc ./kv get hello
    2026-01-16T04:14:15.002+0530 [DEBUG] plugin: starting plugin: path=/bin/sh args=["sh", "-c", "./kv-go-grpc"]
    2026-01-16T04:14:15.004+0530 [DEBUG] plugin: plugin started: path=/bin/sh pid=87908
    2026-01-16T04:14:15.004+0530 [DEBUG] plugin: waiting for RPC address: plugin=/bin/sh
    2026-01-16T04:14:15.024+0530 [DEBUG] plugin: using plugin: version=1
    2026-01-16T04:14:15.024+0530 [DEBUG] plugin.sh: plugin address: address=/var/folders/f0/3m5x22012pl_kcwgrv1xn16m0000gn/T/plugin3694723558 network=unix timestamp="2026-01-16T04:14:15.024+0530"
    2026-01-16T04:14:15.025+0530 [TRACE] plugin.stdio: waiting for stdio data
    world
    
    Written from plugin-go-grpc
    2026-01-16T04:14:15.025+0530 [DEBUG] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
    2026-01-16T04:14:15.026+0530 [INFO]  plugin: plugin process exited: plugin=/bin/sh id=87908
    2026-01-16T04:14:15.026+0530 [DEBUG] plugin: plugin exited
    
  3. Verify the gRPC based Python plugin works as expected. Note the issue described in Error running python-plugin gRPC example #157 still exists
    $ KV_PROTO=grpc KV_PLUGIN="python plugin-python/plugin.py" ./kv put hello world
    2026-01-16T04:15:15.982+0530 [DEBUG] plugin: starting plugin: path=/bin/sh args=["sh", "-c", "python plugin-python/plugin.py"]
    2026-01-16T04:15:15.984+0530 [DEBUG] plugin: plugin started: path=/bin/sh pid=88553
    2026-01-16T04:15:15.984+0530 [DEBUG] plugin: waiting for RPC address: plugin=/bin/sh
    2026-01-16T04:15:16.110+0530 [DEBUG] plugin: using plugin: version=1
    2026-01-16T04:15:16.112+0530 [TRACE] plugin.stdio: waiting for stdio data
    2026-01-16T04:15:16.113+0530 [DEBUG] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unimplemented desc = Method not found!"
    2026-01-16T04:15:18.116+0530 [WARN]  plugin: plugin failed to exit gracefully
    2026-01-16T04:15:18.121+0530 [ERROR] plugin: plugin process exited: plugin=/bin/sh id=88553 error="signal: killed"
    
    $ KV_PROTO=grpc KV_PLUGIN="python plugin-python/plugin.py" ./kv get hello
    2026-01-16T04:15:24.418+0530 [DEBUG] plugin: starting plugin: path=/bin/sh args=["sh", "-c", "python plugin-python/plugin.py"]
    2026-01-16T04:15:24.420+0530 [DEBUG] plugin: plugin started: path=/bin/sh pid=88635
    2026-01-16T04:15:24.420+0530 [DEBUG] plugin: waiting for RPC address: plugin=/bin/sh
    2026-01-16T04:15:24.525+0530 [DEBUG] plugin: using plugin: version=1
    2026-01-16T04:15:24.526+0530 [TRACE] plugin.stdio: waiting for stdio data
    2026-01-16T04:15:24.526+0530 [DEBUG] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unimplemented desc = Method not found!"
    world
    
    Written from plugin-python
    2026-01-16T04:15:26.529+0530 [WARN]  plugin: plugin failed to exit gracefully
    2026-01-16T04:15:26.531+0530 [ERROR] plugin: plugin process exited: plugin=/bin/sh id=88635 error="signal: killed"
    

@kartheek-hc kartheek-hc requested a review from a team as a code owner January 15, 2026 22:47
@kartheek-hc kartheek-hc merged commit a33e454 into main Jan 16, 2026
3 checks passed
@kartheek-hc kartheek-hc deleted the kartheek/fix-grpc-example branch January 16, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants