Closed slow-zhang closed 1 month ago
Use dlv
to debug your server and find out why.
i have using dlv and find the reason just like the title: Gnet hangs on receive incomplete request
Share more details with me?
the redis-bench is hung and for the example the buf is always nil.
you can try the cmd by you self: /usr/local/opt/redis@3.2/bin/redis-benchmark -t set,get -n 10 -d 100000 -r 100000 -c 1 -p <port>
@slow-zhang @panjf2000
if len(buf) == 0
is true, we should return nil,gerrors.ErrIncompletePacket
instead of just return
.
Please see this example of using client in gnet: https://github.com/Spongecaptain/gnet-examples/blob/master/examples/custom_codec/protocol/pb.go#L95, it may help.
thanks for helping! i will fix it later
after I fixed this error , the code can not even pass the benchmark when one client send one request (-c 1, -n 1)
here is the code after fixed: https://github.com/slow-zhang/gnet-test/blob/main/main.go#L142
Please upgrade to gnet v1.6.4 and try again.
so can i assume that there is a bug fix for it?
This issue is marked as stale because it has been open for 30 days with no activity.
You should take one of the following actions:
This issue will be automatically closed in 7 days if no further activity occurs.
This issue was closed because it has been inactive for 7 days since being marked as stale.
If you believe this is a false alarm, please leave a comment for it or open a new issue, you can also reopen this issue directly if you have permission.
What is your question about gnet? i implement a redis server using gnet, but it can only pass the benchmark when one client send one request (-c 1, -n 1) this is
/usr/local/opt/redis@3.2/bin/redis-benchmark -t set,get -n 1 -d 100000 -r 100000 -c 1 -p <port>
when set multi request (-c 1, -n 10) this is
/usr/local/opt/redis@3.2/bin/redis-benchmark -t set,get -n 10 -d 100000 -r 100000 -c 1 -p <port>
here is my impl https://github.com/slow-zhang/gnet-test, am I use gnet by the error way?