From c67fd88978157c1e0a0d4ff5d56136137c183e1f Mon Sep 17 00:00:00 2001 From: erhant Date: Tue, 23 Jun 2026 14:58:09 +0300 Subject: [PATCH] fix: add preemptive poll quit to help with graceful shutting downs, bump flakes --- flake.lock | 16 ++++++++-------- src/lez_explorer_ui_backend.cpp | 20 +++++++++++++++++++- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index 0370f66..23c0109 100644 --- a/flake.lock +++ b/flake.lock @@ -21,11 +21,11 @@ "logos-module-builder": "logos-module-builder_4" }, "locked": { - "lastModified": 1782142627, - "narHash": "sha256-IZslE6yROAxl/FpjlEeZRc+vHKc/1M7kIFvRlgWqDIQ=", + "lastModified": 1782215779, + "narHash": "sha256-x9L1jcK6XfVl40tsqpfrdERLmuGaEDBsFYzNIDdiZPM=", "ref": "erhant/migr-to-logos-module-builder-update-LEZ", - "rev": "014a6dcfe1f5b2529024e8e0fa659e0c546f8652", - "revCount": 42, + "rev": "b5a283124a909854eba695ed213356269b45b414", + "revCount": 45, "type": "git", "url": "https://github.com/logos-blockchain/lez-indexer-module" }, @@ -2013,11 +2013,11 @@ "rust-rapidsnark": "rust-rapidsnark" }, "locked": { - "lastModified": 1782142589, - "narHash": "sha256-K5NtBontpPx1XqnX6jbEzPXSchaLbPlG9689W+C/ExA=", + "lastModified": 1782215206, + "narHash": "sha256-BKwz2qgH2Mu1fSCooc203iYOcxBREcjLnFDF07Ro/H0=", "ref": "erhant/fix-indexer-ffi", - "rev": "2a78b1b3d1b4080930c00ecf23b5c0e73cd646b8", - "revCount": 2773, + "rev": "84c84d885af1f6ccf3ae76a99d93183dbdc3a925", + "revCount": 2778, "type": "git", "url": "https://github.com/logos-blockchain/logos-execution-zone" }, diff --git a/src/lez_explorer_ui_backend.cpp b/src/lez_explorer_ui_backend.cpp index 23a57f7..5b8afec 100644 --- a/src/lez_explorer_ui_backend.cpp +++ b/src/lez_explorer_ui_backend.cpp @@ -3,6 +3,7 @@ #include #include +#include #include #include #include @@ -220,7 +221,13 @@ LezExplorerUiBackend::LezExplorerUiBackend() setDefaultConfig(QString::fromUtf8(kDefaultConfig)); } -LezExplorerUiBackend::~LezExplorerUiBackend() = default; +LezExplorerUiBackend::~LezExplorerUiBackend() +{ + // Defensive: ensure no poll fires while the backend is being torn down. + if (m_pollTimer) { + m_pollTimer->stop(); + } +} void LezExplorerUiBackend::onContextReady() { @@ -239,6 +246,17 @@ void LezExplorerUiBackend::onContextReady() connect(m_pollTimer, &QTimer::timeout, this, &LezExplorerUiBackend::pollTip); m_pollTimer->start(); + // pollTip() makes a synchronous cross-process call into lez_indexer_module. + // On shutdown the host SIGTERMs that dependency and only waits ~3s before + // SIGKILL, while our IPC timeout is ~20s — so a poll landing mid-teardown + // blocks on a dead peer and freezes the window. Stop polling the instant the + // app starts quitting to close that window from our side. + connect(qApp, &QCoreApplication::aboutToQuit, this, [this]() { + if (m_pollTimer) { + m_pollTimer->stop(); + } + }); + // Kick an immediate poll so the view fills without waiting a full interval. pollTip(); }