mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-21 00:41:57 +09:00
[Fix] (MG_Remote): give a spawned server's Welcome the cold-start budget
This commit is contained in:
@@ -128,6 +128,15 @@ namespace MobileGL::MG_Remote::Client {
|
|||||||
// The same bounded handshake deadline the server uses. Bounded, not kWaitForever: a
|
// The same bounded handshake deadline the server uses. Bounded, not kWaitForever: a
|
||||||
// bring-up that never answers has to be a red lane rather than a wedged CI job.
|
// bring-up that never answers has to be a red lane rather than a wedged CI job.
|
||||||
constexpr Uint32 kHandshakeTimeoutMs = 5000;
|
constexpr Uint32 kHandshakeTimeoutMs = 5000;
|
||||||
|
// A freshly spawned server sends Welcome only after its native backend is up, so that one
|
||||||
|
// wait gets the cold-start budget, for the reason the surface-control replies do
|
||||||
|
// (ControlReplyBudgetMs below): on a hosted CI runner the spawned server's eglInitialize
|
||||||
|
// on llvmpipe took 7 s, and the leg died on "no Welcome from the spawned server within
|
||||||
|
// 5000 ms" with the server about to answer. The first CapsSnapshot follows Welcome
|
||||||
|
// promptly, so that wait keeps the steady bound.
|
||||||
|
Uint32 ColdHandshakeBudgetMs() {
|
||||||
|
return std::max(kHandshakeTimeoutMs, MG_Config::Ipc.ColdStartMs);
|
||||||
|
}
|
||||||
// cp (CONTRACT-P6 D5b): bounded, and its expiry is NOT fatal. A peer that
|
// cp (CONTRACT-P6 D5b): bounded, and its expiry is NOT fatal. A peer that
|
||||||
// is gone is a different fact from a peer that is slow, and only the
|
// is gone is a different fact from a peer that is slow, and only the
|
||||||
// doorbell death latch may say which. The surface-control reply wait itself reads
|
// doorbell death latch may say which. The surface-control reply wait itself reads
|
||||||
@@ -1203,10 +1212,10 @@ namespace MobileGL::MG_Remote::Client {
|
|||||||
{
|
{
|
||||||
std::vector<Uint8> frame;
|
std::vector<Uint8> frame;
|
||||||
const MobileGLResult received =
|
const MobileGLResult received =
|
||||||
ReceiveEnvelope(*m_transport, frame, kHandshakeTimeoutMs);
|
ReceiveEnvelope(*m_transport, frame, ColdHandshakeBudgetMs());
|
||||||
if (received != MOBILEGL_OK) {
|
if (received != MOBILEGL_OK) {
|
||||||
MGLOG_E("MG_Remote client: no Welcome from the spawned server within %u ms (rc=%d)",
|
MGLOG_E("MG_Remote client: no Welcome from the spawned server within %u ms (rc=%d)",
|
||||||
kHandshakeTimeoutMs, static_cast<int>(received));
|
ColdHandshakeBudgetMs(), static_cast<int>(received));
|
||||||
Stop();
|
Stop();
|
||||||
return received;
|
return received;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user