net.box: don't send IPROTO_WATCH if server doesn't support it
This commit fixes the following assertion failure that occurrs on an attempt to register a watcher for a connection to a server that doesn't support watchers (e.g. 2.8): src/box/lua/net_box.c:2283: netbox_transport_dispatch_response: Assertion `transport->inprogress_request_count > 0' failed. The problem is that an IPROTO_WATCH request isn't accounted in inprogress_request_count, because the server isn't supposed to reply to it. However, if the server doesn't support the request type, it will reply to it with an error, breaking the assumption made by the client. We fix the assertion itself by explicitly excluding requests with sync=0 from accounting on the client side (IPROTO_WATCH has sync=0), because such requests aren't supposed to have a matching reply. Also, to avoid errors on the server side, we make the client code not send IPROTO_WATCH and IPROTO_WATCH if the server doesn't set the 'watchers' feature bit in reply to the IPROTO_ID request from the client. No user is affected, because IPROTO_WATCH hasn't been officially released yet so neither changelog nor doc is required. Closes #6819 NO_CHANGELOG=bug not released NO_DOC=NO_CHANGELOG
Showing
- src/box/iproto.cc 5 additions, 0 deletionssrc/box/iproto.cc
- src/box/lua/net_box.c 16 additions, 3 deletionssrc/box/lua/net_box.c
- src/lib/core/errinj.h 1 addition, 0 deletionssrc/lib/core/errinj.h
- test/box-luatest/gh_6819_iproto_watch_not_implemented_test.lua 77 additions, 0 deletions...box-luatest/gh_6819_iproto_watch_not_implemented_test.lua
- test/box-luatest/suite.ini 1 addition, 1 deletiontest/box-luatest/suite.ini
- test/box/errinj.result 1 addition, 0 deletionstest/box/errinj.result
Loading
Please register or sign in to comment