diff --git a/di/torq/proc/gateway/gateway.q b/di/torq/proc/gateway/gateway.q index 2dcdb82b..eeffc5ee 100644 --- a/di/torq/proc/gateway/gateway.q +++ b/di/torq/proc/gateway/gateway.q @@ -108,6 +108,10 @@ init:{[config;deps] sconfig:config,(enlist`connections)!enlist .z.m.backendtypes; (.z.m.svc`startup)[sconfig]; registerbackends[]; + / a backend that was down at startup connects later through di.torq.servers' retry/discovery, + / which fires .servers.connectcustom - hook it so serverselect learns about the late arrival. + / Without this the gateway holds a live handle it can never route to until a restart or EOD. + set[`.servers.connectcustom;{[rows] registerbackends[]}]; / di.dataaccess - the getdata query-normalisation layer, on top of the SAME asyncdispatch / instance (idempotent use) so it dispatches via the callbacks/registry set up above. Partition diff --git a/di/torq/proc/gateway/test.csv b/di/torq/proc/gateway/test.csv index a90cf563..52c25ca4 100644 --- a/di/torq/proc/gateway/test.csv +++ b/di/torq/proc/gateway/test.csv @@ -7,3 +7,16 @@ fail,0,0,q,gw.init[()!();(enlist`log)!enlist mlog],1,,init with log but no timer true,0,0,q,`init`asyncexec`asyncexecjpt`reload`version~key gw,1,,module exports init/asyncexec/asyncexecjpt/reload/version true,0,0,q,0