[Fix] (MGPipe, MG_Remote): verify server pack state and reject records after guilty GPU resets

This commit is contained in:
2026-10-05 02:51:19 -04:00
parent c5d25868cf
commit f5b8fe48aa
6 changed files with 65 additions and 108 deletions
+9 -1
View File
@@ -73,6 +73,7 @@
#include <atomic>
#include <cstdint>
#include <type_traits>
namespace MobileGL::MG_Remote::Transport {
@@ -462,7 +463,14 @@ namespace MobileGL::MG_Remote::Transport {
if (!m_cmd->Pop(view, outCorrupt)) {
return false;
}
apply(view);
// A terminal rejection after Pop must not acknowledge an unapplied record.
// A bool callback returning false ends this consumer's session; it cannot retry
// the popped record. Existing void callbacks retain their original semantics.
if constexpr (std::is_same_v<std::invoke_result_t<Apply, const RingRecordView&>, bool>) {
if (!apply(view)) return false;
} else {
apply(view);
}
++m_appliedSeq;
Watermark::AdvanceApplied(*m_control, m_appliedSeq);
m_cmd->PublishApplied();