feat(core): aggregate receive health by account
Track receive health for every process attached to an account while treating unarmed monitoring as compatible rather than degraded. Report the account as healthy while any attached process remains healthy, and mark it degraded only after every attached process has been confirmed stale. Keep health ownership synchronized with process attach, migration, and detach transitions. Fail fast when process ownership and health state diverge instead of silently presenting a healthy status. Add multi-process regression coverage for partial degradation, full degradation, and recovery. Refs #233.
This commit is contained in:
4 files changed
+63
No files matched your search
@@ -104,6 +104,24 @@ describe('BridgeManager PID ownership', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('reports an account healthy while any attached PID still receives packets', () => {
|
||||
const manager = new BridgeManager();
|
||||
manager.onHookLogin(101, '10001', makeSender().client);
|
||||
manager.onHookLogin(202, '10001', makeSender().client);
|
||||
const bridge = manager.getSession('10001')!.bridge;
|
||||
|
||||
expect(bridge.receiveHealthy).toBe(true);
|
||||
|
||||
manager.onPidReceiveHealthChanged(101, false);
|
||||
expect(bridge.receiveHealthy).toBe(true);
|
||||
|
||||
manager.onPidReceiveHealthChanged(202, false);
|
||||
expect(bridge.receiveHealthy).toBe(false);
|
||||
|
||||
manager.onPidReceiveHealthChanged(101, true);
|
||||
expect(bridge.receiveHealthy).toBe(true);
|
||||
});
|
||||
|
||||
it('prefers the most recently rebound live PID, then falls back by recency', async () => {
|
||||
const manager = new BridgeManager();
|
||||
const first = makeSender();
|
||||
|
||||
Reference in new issue
Block a user