fix: add preemptive poll quit to help with graceful shutting downs, bump flakes

This commit is contained in:
erhant 2026-06-23 14:58:09 +03:00
parent 0e8c64fc69
commit c67fd88978
2 changed files with 27 additions and 9 deletions

16
flake.lock generated
View File

@ -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"
},

View File

@ -3,6 +3,7 @@
#include <algorithm>
#include <utility>
#include <QCoreApplication>
#include <QDateTime>
#include <QDir>
#include <QFile>
@ -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();
}