iproto: drop connections on iproto shutdown
This is the first patch in series of graceful Tarantool shutdown. We already have graceful shutdown for client code (through `box.ctl.on_shutdown()`) or network clients (through "box.shutdown" event). This is graceful shutdown of server itself when we exit all threads (instead of abrutly cancelling them) and thoroughly free all resources. We need to introduce iproto_drop_connections for tarantool/tarantool-ee#585 and this is part of graceful iproto shutdown too. During client graceful iproto shutdown we stop accepting new connections thus iproto_drop_connections on iproto shutdown will stop all iproto activities. On connection drop we stop IO for connection, cancel all inprogress requests of the connection and wait while requests are finished and connection is freed. Relay requests are just long polling request of iproto. So on graceful iproto shutdown the fiber processing relay request is cancelled. This will cancel join or subscribe cords of relay because cord_cojoin cancels cord threads. Part of #8423 NO_TEST=rely on existing on tests NO_CHANGELOG=internal NO_DOC=internal
Showing
- src/box/box.cc 15 additions, 0 deletionssrc/box/box.cc
- src/box/box.h 4 additions, 0 deletionssrc/box/box.h
- src/box/iproto.cc 138 additions, 9 deletionssrc/box/iproto.cc
- src/box/iproto.h 8 additions, 0 deletionssrc/box/iproto.h
- src/box/memtx_engine.cc 0 additions, 21 deletionssrc/box/memtx_engine.cc
- src/box/memtx_engine.h 0 additions, 5 deletionssrc/box/memtx_engine.h
- src/box/relay.cc 6 additions, 24 deletionssrc/box/relay.cc
- src/box/relay.h 0 additions, 4 deletionssrc/box/relay.h
- src/box/replication.cc 0 additions, 8 deletionssrc/box/replication.cc
- src/main.cc 1 addition, 0 deletionssrc/main.cc
Loading
Please register or sign in to comment