Repository navigation
Feature rediscovery - #138
Conversation
di.torq.proc.discovery 0.1.0 repackages TorQ code/processes/discovery.q line for line (register, getservices, subs, the startup addw pass and autodiscovery push, .z.pc prune), publishing register/getservices at their legacy root names. di.torq.servers 0.3.0 -> 0.4.0 ports the client half of the protocol from code/handlers/trackservers.q at its legacy root names (.servers.*, .dotz.liveh*): addw, removerows, cleanup, retrydiscovery, autodiscovery, querydiscovery, registerfromdiscovery, addprocs, procupdate, startup and friends, with SERVERS (now carrying attributes) and the trackservers settings as root .servers.* globals. Exported API unchanged. servers.md lists each ported line, the conversions, what was not ported, and the behaviour changes. di.torq: discovery registered as a built-in; legacy STARTUP ported (torq.q l.673) so the hdb registers with discovery as legacy's does; settings/default.q carries legacy default.q's .servers values, settings/discovery.q legacy's discovery settings, settings/hdb.q startup:1b. Note: legacy defaults route every process's connections through discovery - a stack with no discovery process no longer dials process.csv peers directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Legacy TorQ timer modes 0/1/2 schedule the next run from the scheduled start, the actual start and the finish (code/common/timer.q l.8-11); di.timer's 1h/2h/3h mean the same, so legacy mode n is di.timer mode n+1. d04d8d4 ported legacy's .timer.repeat (default mode 2, from finish) as di mode 2 (from actual start) for the discoveryretry and serversretry jobs. Both now use mode 3. The servers suite gains a row asserting mode 3 for both jobs; it fails against d04d8d4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… up during the wait With connections taken from discovery (the builtin default), a process started before discovery registers only a dead discovery row. waitfortype polled retry[], which skips discovery rows and never re-queries, so the rdb, wdb and feed each waited out tpwaittimeout (30s) and aborted init, left running but uninitialised. Reproduced on TorqX-POC with discovery1 last in process.csv. Each poll now calls startup ()!() (reconnect discovery, register, take the rows it names) and keeps retry[]. The servers suite gains a discovery stub that comes up after startup; the waitfortype row fails against 3c67d3c and passes here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
servers.q: the header, registered, init, opencon, timer, startup and waitfortype comments cut to one line each. servers.md: intro and init prose condensed; the .z.pc registration and conventions sections dropped (the conversions list covers the first); tests section listed. Test helper headers cut to one line. Comment and doc changes only; the servers (43), discovery (30) and di.torq (56) suites pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
discoveryregister and connectionsfromdiscovery default to 0b, so a process dials its process.csv peers directly unless the app turns discovery on. debug defaults to 0b. default.q regrouped into discovery, connections and server-record blocks with aligned one-line comments. servers.md updated to match. The di.torq suite gains a row asserting the cascaded defaults for a non-discovery proctype; it fails on the previous default.q. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DIReview Summary0 critical | 2 warning(s) | 3 suggestion(s)
Could not be posted inline
Suggestions
|
| registered:0b; | ||
|
|
||
| / trackservers.q l.13-28: flat config key -> (.servers global;trackservers default) | ||
| settings:`connections`discoveryregister`connectionsfromdiscovery`subscribetodiscovery`discoveryretry`tracknontorqprocess`hopentimeout`retry`retain`autoclean`debug`startup`discovery!( |
There was a problem hiding this comment.
PR 139 has enabled in the dictionary do we need it here?
There was a problem hiding this comment.
Yes, it's needed. It's TorQ's own setting (trackservers.q l.12, gating both retry timers at l.387), and 0.4.0 left it out. It's added here (55caea0).
There was a problem hiding this comment.
should this also use the same qbin as spawnq below?
system QBIN," ",args," -p ",string[port]," -q </dev/null >/dev/null 2>&1 &";
There was a problem hiding this comment.
actually looks like all the QBIN are defined differently in the test, might be minor but maybe they can be standardised
There was a problem hiding this comment.
Agreed, and it was more than style. spawnpeer was the only fixture running $QHOME/bin/q rather than the binary actually running, so a QHOME pointing at a different install would have tested the wrong q. It now uses QBIN, defined once.
- settings gains `enabled` -> .servers.enabled (1b), gating the discoveryretry and serversretry timer jobs (trackservers.q l.12, l.387). Lines are byte-identical to di.torq.servers 0.5.0, so feature-chainedtp inherits them. - test.csv: enabled defaults to 1b. - test.q: spawnpeer runs QBIN (the running q binary) instead of $QHOME/bin/q; QBIN is defined once in the fixture block. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DIReview Summary1 critical | 0 warning(s) | 0 suggestion(s)
|
di.torq.servers converts retry and discoveryretry from a timespan, a "0D00:00:10" string or a number of seconds. TOML has no timespan type, so these settings can now live in .toml files. New test rows fail on the previous code. The di.torq.servers half of c95ce2f from feature-torqx-poc-demo; the chainedtp half lives on feature-chainedtp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DIReview Summary0 critical | 0 warning(s) | 1 suggestion(s)
Suggestions
|
This reverts commit f6788a9. Nothing in this repo sets retry or discoveryretry as a string or number, and it is outside this PR's scope. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DIReview Summary1 critical | 0 warning(s) | 0 suggestion(s)
|
| @@ -0,0 +1,21 @@ | |||
| / Bespoke config for the discovery service - legacy TorQ config/settings/discovery.q (flat keys) | |||
| / list of connections to make at start up | |||
There was a problem hiding this comment.
does enabled need to be added here? i see PR 139 has it in default.q
There was a problem hiding this comment.
enabled:0b, for clarity rather than function. retry and discoveryretry are already 0 here, so this has no effect either way, but it makes the file self-documenting the same way the other settings already are.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds di.torq.proc.discovery (0.1.0), a one-to-one port of TorQ's discovery service, plus the client-side machinery di.torq.servers (0.3.0 → 0.4.0) needed to support it - identity exchange on connect (getdetails/addhw/addw), connection-retry to a discovery service (retrydiscovery/autodiscovery), and the register/query surface (register, querydiscovery, registerfromdiscovery). Settings config moves to a generic, config-driven dict rather than individual hardcoded values, which is what let the missing legacy settings (discoveryregister, connectionsfromdiscovery, retain, autoclean, debug, etc.) land cleanly.
Behaviour change for every process using di.torq.servers: connections now default to coming from discovery rather than process.csv directly; retry intervals default to 5 minutes (was 10s); startup no longer self-excludes the caller's own row, matching legacy.
Includes a fix to waitfortype so it can reach a discovery service that comes up mid-wait, and a comment/doc trim to what-not-why across both touched modules.