| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Port of master a664af99. A unix-domain RPC socket has no TCP keepalive, so
if cl goes unresponsive while the socket stays open (zombie/half-open) an
awaited call hangs forever — nothing throws, the reconnect-on-error path
never fires, and only an app restart recovers. Wrap short-lived calls in a
30s Promise.race timeout (matching lib/health.ts); a timeout rejects with
ETIMEDOUT, now part of isSocketDied, so the client is dropped and the next
call reconnects. Long-polls, in-flight payments (pay/xpay/sendpay/keysend)
and bolt12 round-trips are exempt to avoid leaked debits.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Port of master bd1ece3 to staging. When cl restarts (e.g. autoheal after a
healthcheck timeout), the app's waitanyinvoice long-poll can hang on the now-dead
listen socket: listenerActive stays true forever, nothing restarts it, and
incoming lightning payments silently stop crediting until a manual app restart.
The per-call RPC timeout can't catch this — waitanyinvoice is meant to block.
ensureListenerAlive (run every 120s) now also detects a stalled listener — active
but blocked in waitanyinvoice for >5min — probes cl via the main socket (getinfo),
and only if cl is actually alive treats the listen socket as a zombie: bumps a
listenerEpoch, calls lnListen.reset() (new: drops the proxy socket so the next
call reconnects), and re-arms. The epoch guard makes the wedged invocation bow out
when its waitanyinvoice finally rejects, so we never run two listeners or
double-credit.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Two related defenses around the CLN unix socket connection:
- Global net.Socket.prototype.connect patch: when Bun's
net.createConnection is called on a non-existent unix socket, the
ENOENT it throws bypasses all JS error handlers and crashes the
process. existsSync-check the path first; if missing, emit a normal
'error' event so the caller can handle it gracefully.
- lightningProxy: existsSync gate before constructing LightningClient,
plus a client.on("error") listener that clears the cached client on
socket-died errors instead of letting the unhandled event take down
the process.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|