Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document IPROTO graceful shutdown #2632

Closed
TarantoolBot opened this issue Jan 26, 2022 · 3 comments
Closed

Document IPROTO graceful shutdown #2632

TarantoolBot opened this issue Jan 26, 2022 · 3 comments
Labels
iproto Related to the iproto protocol

Comments

@TarantoolBot
Copy link
Collaborator

A new IPROTO request type was introduced - IPROTO_SHUTDOWN, code 77.
When asked to shut down (os.exit() is called or SIGTERM signal is
received), a server stops accepting new connections and sends a packet
of this type to each of its clients that support the graceful shutdown
feature (see below how a server figures out if a client supports the
feature). The server won't exit until all the clients that were sent the
packets close connections. If all the clients don't close connections
within the shutdown timeout, the server will exit anyway. The default
shutdown timeout is 3 seconds, and it can be configured with
box.ctl.set_on_shutdown_timeout(), which also determines the timeout
of box.ctl.on_shutdown() triggers.

An IPROTO_SHUTDOWN packet doesn't have any keys in its headers (not
even sync number or schema version) nor a body. A client isn't supposed
to reply to an IPROTO_SHUTDOWN packet. Instead it's supposed to close
its connection as soon as possible. A client may wait for pending
requests to complete and even send new requests after receiving an
IPROTO_SHUTDOWN packet. The server will serve them as usual until it
exits on timeout.

Clients that support the graceful shutdown feature are supposed to set
the IPROTO_FEATURE_GRACEFUL_SHUTDOWN feature (bit 4) when sending an
IPROTO_ID request to a server. Servers that support the feature set
the same bit in reply to an IPROTO_ID request. Introduction of this
feature bumped the IPROTO protocol version up to 4.
Requested by @locker in tarantool/tarantool@6f29f9d.

@locker
Copy link
Member

locker commented Jan 26, 2022

Related issue: #2633

@locker
Copy link
Member

locker commented Jan 28, 2022

Hold on! We are currently thinking about reworking the feature implementation, see tarantool/tarantool#6813. I'll update the ticket once we agree how to proceed.

@locker
Copy link
Member

locker commented Feb 2, 2022

tarantool/tarantool#6813 was merged. It dropped IPROTO_SHUTDOWN request and reworked graceful shutdown using watch/event so this ticket can be closed.

@locker locker closed this as completed Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iproto Related to the iproto protocol
Projects
None yet
Development

No branches or pull requests

3 participants