ix: prevent corestore corruption during graceful shutdown

- Reorder shutdown sequence to close pairing operations before DNSPass
- Add proper tracking and cleanup of active Autopass.pair() operations
- Handle shared corestore conflicts between pairing ops and main DNSPass
- Ignore expected "store already closed" errors from pairing operations
- Consolidate all Autopass resource cleanup in PHASE 2.5

This fixes the "Corestore is closed" uncaught exceptions and corruption
that occurred when both pairing operations and DNSPass tried to close
the same shared corestore during shutdown.
This commit is contained in:
Raven Scott
2025-12-26 23:24:51 -05:00
parent e8f920a7aa
commit 62ac5a4b50
2 changed files with 251 additions and 48 deletions
+7 -1
View File
@@ -77,7 +77,13 @@ async function getAllEntries(pass = state.dnsPass, useCache = true) {
logDebug('Core', 'dnsPass is closed, returning cached entries');
return entriesCache || [];
}
// Check if pass is ready - if not, wait briefly or return cached entries
if (!pass.ready) {
logDebug('Core', 'dnsPass is not ready yet, returning cached entries');
return entriesCache || [];
}
const entries = [];
try {
const stream = pass.list();