[Tarantool-patches] [PATCH v4 8/9] iproto: implement interactive transactions over iproto streams

Vladimir Davydov vdavydov at tarantool.org
Thu Aug 12 13:48:59 MSK 2021


On Thu, Aug 12, 2021 at 12:50:45PM +0300, mechanik20051988 wrote:
> diff --git a/src/box/call.c b/src/box/call.c
> index a6384efe2..0ce84b1ed 100644
> --- a/src/box/call.c
> +++ b/src/box/call.c
> @@ -715,7 +740,17 @@ iproto_msg_new(struct iproto_connection *con)
>  static inline bool
>  iproto_connection_is_idle(struct iproto_connection *con)
>  {
> +	/*
> +         * The check for 'mh_size (streams) == 0' was added, because it is

Please fix formatting (you use spaces instead of tabs here).

> +         * possible that when disconnect occurs, there is active transaction
> +         * in stream after processing all messages. In this case we send
> +         * special message to rollback it, and without this check we would
> +         * immidiatly send special message to destroy connection. This would

immediately

> +         * not lead to error now, since the messages are processed strictly
> +         * sequentially, and rollback does not yield, but it is not safely and

and?

> +	 */
>  	return con->long_poll_count == 0 &&
> +	       mh_size(con->streams) == 0 &&
>  	       ibuf_used(&con->ibuf[0]) == 0 &&
>  	       ibuf_used(&con->ibuf[1]) == 0;
>  }


More information about the Tarantool-patches mailing list