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 9.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 server SHOULD close the session with GOAWAY_TIMEOUT after a
sufficient 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 any UNSUBSCRIBE messages to 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 server closes the session with a
GOAWAY_TIMEOUT if the client doesn't close the session quickly enough.