[Tarantool-patches] [PATCH 1/1] iproto: show real port in logs and box.info.listen

Sergey Ostanevich sergos at tarantool.org
Tue Mar 3 16:26:50 MSK 2020


Thanks, LGTM. 
The misunderstanding with protocol was my off-the-source fault.

Sergos


On 22 фев 16:00, Vladislav Shpilevoy wrote:
> Hi! Thanks for the review!
> 
> >> Box.cfg{listen = 0} automatically chooses a port. But it was
> >> impossible to learn a real port the instance is bound to.
> >                 ^^^^^ obtain?
> 
> Done.
> 
> >> diff --git a/src/box/iproto.cc b/src/box/iproto.cc
> >> index 34c8f469a..522c066be 100644
> >> --- a/src/box/iproto.cc
> >> +++ b/src/box/iproto.cc
> >> @@ -129,6 +129,23 @@ unsigned iproto_readahead = 16320;
> >>  /* The maximal number of iproto messages in fly. */
> >>  static int iproto_msg_max = IPROTO_MSG_MAX_MIN;
> >>  
> >> +/**
> >> + * Address the iproto listens for, stored in TX
> >> + * thread. Is kept in TX to be showed in box.info.
> >                                   shown, since V3?
> 
> Done.
> 
> >> + */
> >> +static struct sockaddr_storage iproto_bound_address_storage;
> >> +/** 0 means that no address is listened. */
> >> +static socklen_t iproto_bound_address_len;
> >> +
> >> +const char *
> >> +iproto_bound_address(void)
> >> +{
> >> +	if (iproto_bound_address_len == 0)
> >> +		return NULL;
> >> +	return sio_strfaddr((struct sockaddr *) &iproto_bound_address_storage,
> >> +			    iproto_bound_address_len);
> >> +}
> >> diff --git a/src/box/iproto.h b/src/box/iproto.h
> >> index edb24a7ed..201e09df5 100644
> >> --- a/src/box/iproto.h
> >> +++ b/src/box/iproto.h
> >> @@ -80,6 +80,13 @@ iproto_request_count(void);
> >>  void
> >>  iproto_reset_stat(void);
> >>  
> >> +/**
> >> + * String representation of the address served by
> >> + * iproto. To be showed in box.info.
> >                     shown
> 
> Done.


More information about the Tarantool-patches mailing list