Skip to content
Snippets Groups Projects
user avatar
Vladimir Davydov authored
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
857ab307
History