Skip to content
Snippets Groups Projects
Commit 857ab307 authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Kirill Yukhin
Browse files

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
parent 3c6a3a1d
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment