Open bartlomieju opened 1 month ago
I think my real issue is that pglite still isn't working correctly. But it's an intermittent issue, so I'm making potentially wrong assumptions about what's causing it. Therefore I don't think detecting reload with --watch
is actually needed.
So the real issue is: pglite goes into an unrecoverable state, and I get this error when I try to start it:
RuntimeError: Aborted(). Build with -sASSERTIONS for more info.
at abort (file:///home/alex/.cache/deno/npm/registry.npmjs.org/@soapbox.pub/pglite/0.2.10/dist/postgres.js:740:11)
at __abort_js (file:///home/alex/.cache/deno/npm/registry.npmjs.org/@soapbox.pub/pglite/0.2.10/dist/postgres.js:7244:7)
at abort (wasm://wasm/postgres.wasm-02856ac6:1:7189834)
at errfinish (wasm://wasm/postgres.wasm-02856ac6:1:2120762)
at InitWalRecovery (wasm://wasm/postgres.wasm-02856ac6:1:5426759)
at StartupXLOG (wasm://wasm/postgres.wasm-02856ac6:1:5273250)
at InitPostgres (wasm://wasm/postgres.wasm-02856ac6:1:625849)
at AsyncPostgresSingleUserMain (wasm://wasm/postgres.wasm-02856ac6:1:2510013)
at pg_initdb (wasm://wasm/postgres.wasm-02856ac6:1:3412565)
at Object.Module._pg_initdb (file:///home/alex/.cache/deno/npm/registry.npmjs.org/@soapbox.pub/pglite/0.2.10/dist/postgres.js:10397:109)
The InitWalRecovery
is what catches my eye. I am guessing the WAL is getting corrupted. It happens during live reload, but it also happens after I Ctrl+C and star it again. I don't know if this is even a Deno bug.
@alexgleason You should be able to do addEventListener("unload", () => pglite.close())
, I think.
@lucacasonato that works with ^c
but not when it detects a file change and restarts, re: --watch
Discussed in https://github.com/denoland/deno/discussions/25601