FDio / govpp

Go toolset for the VPP.
Apache License 2.0
193 stars 82 forks source link

Question: missing binary API reply with sequence number #78

Closed fatelei closed 1 year ago

fatelei commented 1 year ago

vpp is a single thread server, so it handles request one by one, and response it one by one. i don't know how the disorder will be happen.

ondrej-fabry commented 1 year ago

To be honest, I am not really sure what you are asking here. The request and replies are matched by the context field in the message itself. Each Channel or Stream has unique context number which is used in the request and VPP replies using the same context, that is how GoVPP client matches request/reply even if they are processed out of order.

fatelei commented 1 year ago

i using govpp, i found this error missing binary API reply with sequence number. Because of vpp is single thread server, it handle the request one by one, so i think the vpp will echo the request number in order. I want to known what kind of situation will lead this error.

fatelei commented 1 year ago

close it, i will check vpp is single thread or multi thread. i

ondrej-fabry commented 1 year ago

Could you share the code you are using to send/receive requests?

ondrej-fabry commented 1 year ago

This error message occurs when you receive a reply that has higher sequence number than expected. The sequence number is actually part of the context field mentioned above and each Channel contains it's own sequence number which is increased every time you send request. The RequestContext you get from SendRequest will be used to check the sequence number in the reply you get to verify it matches. However if you use the Channel in multiple goroutines or if you send multiple requests simultaneously before receiving reply from the previous request you will run into this error.