feat(bridge): connect when a pipe is already up after load fails
A failed load used to stay in the error state. If the pipe is already listening, connect instead, and keep retrying that case on later checks.
This commit is contained in:
3 files changed
+41
-1
No files matched your search
@@ -358,6 +358,15 @@ export class HookSession extends EventEmitter {
|
||||
this._error = errMsg(error);
|
||||
this.setStatus('error', this._error);
|
||||
this.log.error('load failed: PID=%d err=%s', this.pid, this._error);
|
||||
// The module can already be listening even when this call returns
|
||||
// failure: another load left it resident, or it came up after the
|
||||
// call returned. A live pipe still has the account state, so connect
|
||||
// instead of staying on the failed load.
|
||||
await this.pipeWatcher.tickNow?.();
|
||||
if (!this.disposed && this.pipeWatcher.isPipeLive(this.pid)) {
|
||||
this.log.info('PID=%d load failed but pipe is up; connecting', this.pid);
|
||||
await this.reconcilePipeUp();
|
||||
}
|
||||
}
|
||||
return this.toInfo();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user