iproto: show real port in logs and box.info.listen
Box.cfg{listen = 0} automatically chooses a port. But it was impossible to obtain a real port the instance is bound to. An ability to see a real port may help to make test-run more robust, because it won't depend on which ports are free, and won't need to pre-choose them in advance. Now box.info.listen shows a real address, or nil when listen is turned off. Also a real address is logged instead of the dummy 0-port one. Closes #4620 @TarantoolBot document Title: box.info.listen - real address New value in box.info - listen. It is a real address to which the instance was bound. For example, if box.cfg.listen was set with a zero port, box.info.listen will show a real port. The address is stored as a string: - unix/:<path> for UNIX domain sockets; - <ip>:<port> for IPv4; - [ip]:<port> for IPv6. If the instance does not listen anything, box.info.listen is nil.
Showing
- src/box/iproto.cc 29 additions, 2 deletionssrc/box/iproto.cc
- src/box/iproto.h 7 additions, 0 deletionssrc/box/iproto.h
- src/box/lua/info.c 9 additions, 0 deletionssrc/box/lua/info.c
- src/lib/core/evio.c 8 additions, 0 deletionssrc/lib/core/evio.c
- test/box-tap/cfg.test.lua 13 additions, 1 deletiontest/box-tap/cfg.test.lua
- test/box/info.result 1 addition, 0 deletionstest/box/info.result
Loading
Please register or sign in to comment