The kernel's sink readers still take handle.plugin, handle.kind and handle.config off a live handle, so an owner's accessor ends the daemon tick that PR #2057 left it beside
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, node.js
Research direction
Start with the sink registry in src/core/registry/sinks.js and the reader paths in src/core/daemon/runtime.js, src/core/daemon/status.js, and src/core/sinks/driver.js. Then read test/core/sink-hostile-instance-name.test.js, which is identified as the natural home for the plugin, kind, and config accessor cases. Done means those readers use registry-record values and hostile accessors no longer abort status collection or the daemon tick, nor prevent an honest neighboring sink from exporting.
Written by the indexing model from the issue text.
Description
Feature or issue
PR #2057 closed the handle.instanceName half of the reader problem #1976 names: hyp status, the daemon's per-tick status.sinks write and the sink driver's due check now take the instance name from the registry's own record instead of off the live handle. The sibling properties read on the very same lines were deliberately left, and each one reproduces the identical outage.
A sink handle is a live object its owner still holds through ctx.sinks.get (LLP-documented at src/core/runtime/activation.js, the get/list half of #1961), so every one of its properties is replaceable with an accessor of the owner's.
Verified against 60f41ac5 (PR #2057's head), with two live instances materialized through the owner's real activation context and a throwing accessor installed on the one that sorts first:
src/core/daemon/runtime.js:1876-1881readshandle.pluginandhandle.kindone line after the guarded name.collectSinkSnapshotsthrewboom from the ownerfor both. This is the serious one: the call atsrc/core/daemon/runtime.js:918sits after the tick's.catch(...)at :912-917, the tick is driven bysetInterval(() => { void runTick() }, ...)at :956, and there is nounhandledRejectionhandler anywhere in this repo (src/core/otlp/server.js:255records exactly that). So the throw is an unhandled rejection and ends the daemon, once, on the first tick after the accessor is installed.src/core/daemon/status.js:1851readshandle.pluginandhandle.kindon the same line assinkInstanceName(handle).collectHypAwareStatusthrew the same error. Nothing on that path catches, sohyp statusstill goes down whole.src/core/sinks/driver.js:80readshandle.config?.scheduleimmediately after the hardened name read and ahead of the due check. A throwingconfigaccessor threw out ofdriver.tick, so the honest neighbour sorting behind the hostile instance never exported.handle.pluginis read again in the failure path at:326and:286.
The fix PR #2057 established already has the shape this needs: the kernel knows all three facts at instantiate time (args.kind, the contribution plugin it resolved, and the config row it validated), so the module-level record in src/core/registry/sinks.js can carry them beside the name it already records, and the readers take them from there.
Out of scope here and worth their own pass: src/core/commands/sync.js, src/core/commands/sink.js and src/core/sinks/pending.js read handle.instanceName unguarded too, but those are user-invoked CLI commands that fail loudly at the terminal rather than silently in a daemon loop.
Reproduction
Install a throwing accessor on a live handle taken back through the owner's own ctx.sinks.get, then call collectSinkSnapshots:
Object.defineProperty(ctx.sinks.get('a-hostile'), 'plugin', {
configurable: true,
get() { throw new Error('boom from the owner') },
})
collectSinkSnapshots({ runtime, sinkSnapshots: new Map() }) // throws
test/core/sink-hostile-instance-name.test.js already stages exactly this for instanceName and is the natural home for the plugin, kind and config variants.
Triage addendum (PR #2097 at cd0d42d4ff03dc3c4e6439f8cef9dc6f43d76212): three findings from PR #2097's review land in this issue's class and are deferred here rather than duplicated.
- Finding 2: the registry record PR #2097 introduces is a shallow copy (
{ ...config },src/core/registry/sinks.js:423/:525), so nested values stay shared with the owner's live object. Every current reader istypeof === 'string'-gated on top-level scalars, but a reader this issue converts to the record must not assume nested isolation:src/core/commands/sink.js:91pullsconfig.maintenance, a nested object, and would share it by reference. - Finding 4:
describeDestination's third branch (src/core/commands/sync.js) still readshandle.pluginlive - it can mis-name or throw (loudly, at the terminal) but cannot hide a row, since itsoffMachine: nullsurvives the plan filter. The record-widening this issue proposes is the fix: carrypluginbesideinstanceNameandconfigand read it from the record. - Finding 5:
src/core/sinks/driver.js:86still readshandle.config?.schedulelive (already named above), so the plan (recorded config) and the driver's due check (live config) can diverge - only in the benign direction: the plan over-states what leaves the machine.
- Dominant language
- JavaScript
- Stars
- 11
- Forks
- 0
- Avg merge
- 2h 55m
- Merged PRs (30d)
- 294
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hyparam/hypaware
-
neutral:fix
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
report_commands.js runtime output still says 'server' in four places; one names the destinationOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 76/100
Maintainers usually reply within 1 day
All issues in hyparam/hypaware
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
LucasSantana-Dev/Lucky#2945 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
brijeshb42/monaco-vim#175 ·
-
good first issue
Difficulty 2/5 3-5 days Newbie friendliness 62/100
paipai1999/POS-system#3 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
MikeMcl/bignumber.js#418 ·