Skip to content

Fix/process utilities - #777

Open
jaen15marcos wants to merge 3 commits into
DataIntellectTech:masterfrom
jaen15marcos:fix/process-utilities
Open

jaen15marcos wants to merge 3 commits into
DataIntellectTech:masterfrom
jaen15marcos:fix/process-utilities

Conversation

@jaen15marcos

@jaen15marcos jaen15marcos commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor
  • launchprocess.sh split its whole command line on -, so a value with a dash in it (a path, say) broke every argument after it. It now reads one flag at a time.
  • Process names: a process started without TorQ’s handlers (every tickerlogreplay, by default) gave discovery a null name and type; it now sends its own.
    .os.md creates missing parent folders.
  • .html.wssub failed with 'type on a function such as the monitor’s lmchart, so the monitor’s start never returned its data. A new tests/monitor suite covers it.
  • tests/bglaunchprocess waits for discovery instead of a fixed 2 seconds; with discovery off (under a connection limit, #725 dev #727) it finds the launched process from a port file; and it checks that each launch and kill is logged as successful.
  • tests/stp/stripe no longer depends on one developer’s folder or on files TorQ no longer has, and waits for restarted RDBs and replayed logs instead of fixed sleeps.

Testing: as above, master 618 of 848, master with this PR 672 of 888.

The script split its whole command line on '-', so any value with a dash
in it (a path such as /opt/torq-prod/...) broke every argument after it,
and .sys.bglaunch started a process with a broken -p. It now reads each
-flag and the words after it up to the next flag, and builds the same
start line as before.

tests/bglaunchprocess waited a fixed 2 seconds after launching its
second process and then looked it up in discovery, where it was not yet
registered. The test process registers with discovery during its own
start-up, while it runs the tests, and discovery's register calls back
into the registering process (.servers.addw) and waits for the answer.
Until the test process next called discovery, discovery could not accept
the new process's connection, and that next call was the lookup itself.
The suite now asks discovery until the process is there (up to 10
seconds).

That process listens on a port of its own choosing (-p 0W), so discovery
was the only way the suite could find it, and under a connection limit,
such as KDB-X's free licence, TorQ turns discovery off (DataIntellectTech#727) and the last
eight rows failed. With discovery off, the suite's processes now write
their port to a file in KDBLOG when they start, and the suite finds the
process there; run.sh removes the files.

The suite also checks that each launch and kill is logged as successful,
through TorQ's logging hook (.lg.ext). Its two checks that a killed
process's pid is no longer in use list the user's processes by user id
(ps -u $(id -u)): with USER unset, ps -u printed only its header, and the
checks passed without checking anything.
… .os.md create parent folders; fix stp/stripe

- When discovery connects to a process it asks for .servers.getdetails,
  and a process started without TorQ's handlers (every tickerlogreplay
  process, by default) does not have it. The fallback then sent back a
  null procname and proctype, and discovery replaced the process.csv
  entry with one named after the script (torq.q) and with no type, so
  nothing could find the process by type afterwards. That only happens
  when discovery reaches the process after it is already listening, so it
  depended on start-up timing. The fallback now sends .proc.procname and
  .proc.proctype, which every TorQ process sets whether or not it loads
  the handlers.

- .os.md ran mkdir without -p, so it failed whenever the parent folder did
  not exist yet. stp/stripe writes its results to
  tests/stp/results/stripe/, and in a fresh checkout, or when it runs on
  its own, tests/stp/results is not there yet. Windows' mkdir already
  creates the parents.

- stp/stripe began with cd $HOME/TorQ/deploy/TorQ/latest and sourced
  setenv.sh from there, so it only ran on the machine it was written on.
  Like every other run.sh it now expects the environment to be set. Its
  RDBs subscribe with -.rdb.subfiltered 1, which reads
  rdbsub/rdbsub<n>.csv, and neither TorQ nor the Starter Pack has those
  files any more (the Starter Pack's rdb.q used to write them); the
  suite now has its own, one per RDB, as docs/utilities.md describes,
  and points each RDB at its file. Two checks read .rdb.procnum, which
  the Starter Pack no longer defines; they now take the RDB's number
  from its name, as rdb.q does. After restarting two RDBs the suite
  reopened their handles before they were up; it now waits for each
  (up to 30 seconds). It replayed the logs on the restarted RDBs by
  sending "-11!`" joined to the log path, which q cannot parse when the
  path has a dash in it; it now sends the path itself. The last check
  slept one second after each of five batches (up to 100,000 rows); it
  now waits until each batch has arrived (up to 30 seconds).
wssub called sub, which builds a table schema, and the monitor's start
subscribes lmchart, a function, so it stopped with 'type and start never
returned its data. wssub now registers the handle against each name as
sub does for a table, without building a schema, and ` still subscribes
every value.

tests/monitor is a new suite which starts a monitor and calls start, as
its web page does on every connection. The checks: start runs; calling it
twice leaves one subscription each; each subscription is the handle and `
(all syms), as the original wssub registers for a table; wssub `
subscribes every value; an unknown name is still rejected.
@chris-brown26

Copy link
Copy Markdown

Testing: as above, master 618 of 848, master with this PR 672 of 888.

Are the ones still failing verified and are all the tests touched in this PR now passing?

@jaen15marcos

Copy link
Copy Markdown
Contributor Author

Testing: as above, master 618 of 848, master with this PR 672 of 888.

Are the ones still failing verified and are all the tests touched in this PR now passing?

Yes, basically all the test pass now when merged together, but merging this PR alone will go the test failures go from 618/848 -> 672/888.

@jaen15marcos jaen15marcos reopened this Dec 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants