MOQT requires a long-lived and stateful session. However, a service provider needs the ability to shutdown/restart a server without waiting for all sessions to drain naturally, as that can take days for long-form media. MOQT enables proactively draining sessions via the GOAWAY message (Section 10.4).
The server sends a GOAWAY message, signaling the client to establish a new
session and migrate any Established subscriptions. The GOAWAY message optionally
contains a new URI for the new session, otherwise the current URI is
reused. The GOAWAY message contains a Timeout indicating how long, in
milliseconds, the sender intends to wait before closing the session. The sender
SHOULD close the session with GOAWAY_TIMEOUT after the indicated timeout if
there are still open subscriptions or fetches on a connection.
When the server is a subscriber, it SHOULD send a GOAWAY message to downstream subscribers prior to unsubscribing from upstream publishers.
After the client receives a GOAWAY, it's RECOMMENDED that the client waits until
there are no more Established subscriptions before closing the session with NO_ERROR.
Ideally this is transparent to the application using MOQT, which involves
establishing a new session in the background and migrating Established subscriptions
and published namespaces. The client can choose to delay closing the session if
it expects more OBJECTs to be delivered. The sender closes the session with a
GOAWAY_TIMEOUT if the peer doesn't close the session within the
indicated Timeout.