8000 Added `close()` by kenhkan · Pull Request #35 · noflo/noflo · GitHub
[go: up one dir, main page]

Skip to content

Added close() - #35

Closed
kenhkan wants to merge 1 commit into
noflo:masterfrom
kenhkan:http
Closed

kenhkan wants to merge 1 commit into
noflo:masterfrom
kenhkan:http

Conversation

@kenhkan
@kenhkan kenhkan commented Jul 27, 2012
Copy link
Copy Markdown
Contributor

Shut down the HTTP server programmatically so that you can move on to the next test cleanly when testing

Shut down the HTTP server programmatically so that you can move on to the next test cleanly when testing
@kenhkan kenhkan closed this Jul 27, 2012
AsherBond pushed a commit to AsherBond/noflo that referenced this pull request Oct 12, 2026
< 10000 svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-cross-reference">
bergie added a commit that referenced this pull request Oct 14, 2026
Work document #37 phase 2, commit 11. The default catalogs ship from
@noflo/fbp-protocol as digest-addressed CC0 artifacts: the ui
positional canvas catalog (ui.x/ui.y for nodes, exports, and IIPs;
ui.route/ui.routePoints for edges — the Appendix A intents and WD #35
semantics re-declared), the runtime config catalog
(runtime.highWaterMark, edges only — the field SPEC §5 already names),
and the std datatype catalog mapping the 13 core datatypes to schemas
or the opaque marker. The ui and runtime catalogs validate against the
shipped meta-catalog format and pin it at its shipped digest; tests
verify shipped-byte identity and digest stability.
bergie added a commit that referenced this pull request Oct 18, 2026
…the buffers' remaining work

The fanout clone-drop verification (the un-skipped two shapes) revealed
the deadlock's precise mechanism — and it was never a clone-drop. The
probe showed: every collector firing before the late-arriving standing
config declined on the missing precondition; the config's arrival fired
exactly ONE round (consuming one pair); and the remaining buffered pairs
stranded — no arrival ever comes to wake them. The has-first
decline-and-wait model has an incomplete wakeup: arrivals wake, but an
activation that CONSUMED input leaves buffered work that nothing wakes.

The fix is the firing model's own guarantee (#47: every state change that
could satisfy a precondition causes an evaluation) applied to its natural
completion: a consumption IS a state change. The drain pump: when an
activation that consumed input deactivates, one scheduled offer fires the
process for every scope still holding deliverable input. Scheduled (not
recursive), so a multi-pair drain chains through macrotasks without stack
depth; each offer either consumes (progress) or declines (the buffers
unchanged, no further offer) — the pump terminates with the buffers. The
ready-scope walk is shared with the arrival walk (handleIP), deduped per
scope, and the pump's offer is guarded by the closedown state and the
in-flight load.

- ProcessContext gains the consumed counter; ProcessInput.get increments
  it on ownership-moving reads (control reads are non-consuming and do
  not count)
- The two clone-drop tests un-skipped and passing: the unscoped
  sequential flow drains all pairs (the collector's pairing crossover
  under reversed async inner delivery is the documented
  parallel-positional-streams contract, pinned by the test's scope
  variant); the scoped interleaved flow pairs per scope correctly — the
  fixture's encoding port needed the standing-config idiom
  (scoped: false), not an engine change
- The bare-class loader finding: fixed — createComponent constructs
  bare classes with new (detected by prototype.constructor identity and
  the class source prefix), while factory functions keep the plain-call
  contract; the registered-factory behavior is unchanged
- The wrapAssembly subgraph capability stays open (the sync registry
  contract vs the async graph-instance harvesting needs its own design
  pass) — the verification spec pins the gap's current observable

The #35 update-#6 sidestep note (bracket-strip before wrapped adapters)
can be revisited: the correlation now works
AsherBond pushed a commit to AsherBond/noflo that referenced this pull request Oct 19, 2026
The firing model follows the port's role. A control port is a gate —
a standing, non-consumingly-read value whose arrival re-fires the
process once per scope that holds data on the component's other ports,
with the control value readable in that firing and left buffered.
Regular firing ports fire directly per arrival; regular non-triggering
ports share the gate machinery (work document noflo#1 noflo#607, whose machinery
was previously reachable only through an explicit triggering:false
declaration no shipped component made).

Previously a control arrival fired one scopeless activation: the
arriving IP's context carried no scope, so the process could not see
scoped buffers and declined — standing configuration arriving after
scoped messages silently failed to re-fire the waiting processes. That
shape stranded burst messages behind late-arriving configuration in
wrapped-adapter pipelines (the noflo-jekyll burst investigation, work
documents noflo#35/noflo#36), and forced the workaround of declaring
configuration ports as firing ports.

The leak-persistence fixture moves to its honest data-triggered shape:
a control arrival no longer opens an activation at all, so the
read-then-decline leak via a control arrival is now impossible; the
data-triggered shape (read the standing control value inside a
data-fired activation, then decline) still leaks, still warns, and is
still deliberately not auto-closed
AsherBond pushed a commit to AsherBond/noflo that referenced this pull request Oct 19, 2026
A message lacking the mapped field is malformed for the adapter: the
absence surfaces on the extractor's new error outport — which the
generated adapter graphs wire into the collector's error accumulation —
so the message completes on the error leg with the failure recorded,
instead of a silent undefined delivery the inner component would crash
on (the noflo-jekyll includes-port crash shape, work document noflo#35
update noflo#13 question (b)). A field present with a null value is a value
and delivers.

asAssembly wires each extractor's error port into the collector's
error accumulation, and the collector node moves ahead of the
extractors so the error legs can wire to it.

CollectFields' docs state the error contract normatively: the inner's
error port is the message's terminal event for its scope — the
collector fires with the errors and whatever fields delivered; inner
data arriving after the error for the same scope has no collector
waiting and surfaces in the shutdown diagnostics. Pairing is per scope
via the scope-aware has-checks (work document noflo#35 update noflo#13 question
(c)).

Specs: ExtractField's missing-field and null-is-a-value units, and the
end-to-end malformed-message case through a wrapped adapter — both
messages complete scope-isolated, and closing the boundary runs the
full closedown cascade through the adapter
AsherBond pushed a commit to AsherBond/noflo that referenced this pull request Oct 19, 2026
…ent engine

Substantial engine work has landed since the document's open items were
written (the firing model noflo#47, the scoped liveness noflo#45, bounded edges
noflo#38, the deterministic closing noflo#45/noflo#46) — this verification pass checks
whether each is still open, against the current engine:

- The two skipped fanout-clone-drop tests un-skipped and run: BOTH
  SHAPES STILL HANG at their timeout — the sequential multi-message
  clone-drop is real and current. Re-skipped with the fresh evidence;
  the buffer-lifecycle fix remains the document's central open item
- The adapter bracket correlation: VERIFIED WORKING — the spec pins the
  end-to-end shape the jekyll pipeline sidestepped (concurrent scoped
  messages with bracketed inner streams pair per message, and the
  closedown completes on the boundary disconnect). The 'cleaner end
  state' gap from work document noflo#35 update noflo#6 is closed by the engine
  work; this spec is now the green pin, not a gap report
- The bare-class loader finding: verified still open — the registered
  bare class throws 'cannot be invoked without new' (the message names
  the class); the spec pins the current behavior for the fix to flip
- The wrapAssembly subgraph capability: verified still open — a graph
  definition skips with asAssembly's rejection (the observable reason
  the capability gap carries today)
bergie added a commit that referenced this pull request Oct 19, 2026
…ession pin (work document #48)

Distills the noflo-jekyll document leg (work document #35 updates
#14-#22) to its engine shape and runs it through the actual wrapAssembly
machinery: a gate-model render component — standing bracket-framed
config on a scoped:false control port read non-consumingly, per-message
scoped data on two ports gated on both — wrapped as an assembly adapter
(Fork, field extractors, CollectFields), driven with bracket-framed
scoped message envelopes whose arrival order races the config and
stagger with async jitter inside open activations, then driven to EOT
with the closedown cascade asserted.

The negative result this suite pins: on the current engine (post-#1094
control gates, #1092 drain-based closing, #1099 drain pump), roughly
1300 randomized runs across staggered, burst, bounded-edge, multi-
registration-config, and deep-overlap variants delivered every message
and closed down — the intermittent drop class the testbed documented
did not reproduce. Three randomized variants run in CI; the full matrix
rides the WD48_* env knobs.
bergie added a commit that referenced this pull request Oct 19, 2026
#35 update #23's out-mapping semantics)

The two remaining unlocks of the noflo-jekyll FrontMatter substitution
(update #23 called the out-mapping semantics the single unlock; the
fence-matcher item shipped in noflo-yaml 2.0.0-alpha.2):

- assembly-utils ExtractField maps dot paths: the field name may carry
  segments (frontmatter.head), each walked as a plain own-property
  read. An absent segment at any level is the same malformed-message
  error the flat mapping reports, naming the full mapped path; arrays
  do not walk.
- assembly-utils CollectFields gains the spread mapping: a * field name
  in the fields config merges the inner output's keys into the
  message's top level — for inners whose output is a flat field map
  destined for the message (the parsed front matter), between the
  named-field nesting and the whole-message replace. The spread merges
  on top of the replace and the named fields, must be a plain object,
  and only one * is allowed.
- asAssembly validates the spread marker at wrap time and carries it
  into the generated collector's fields config.

Pinned by spec: the dot-path walk (flat, nested, deep, null values, the
absence shapes) and the spread semantics (merge, overwrite, precedence
over the named fields and the replace, the non-object error, the doubled
config), plus the wrap-time validation and the generated config.

End-to-end validation: the noflo-jekyll testbed's jekyll/FrontMatter
relay (76 lines, the custom front-matter split-and-parse) retires in
favor of wrapped yaml/ExtractFrontmatter + yaml/ParseYaml with the
nested-path extraction and the spread — the parity comparison against
the Jekyll-generated reference stays byte-identical and the stress loop
runs deterministic.
bergie added a commit that referenced this pull request Oct 19, 2026
…s errors (work document #35 update #23 review)

Two documented-invariant violations the #1106 review verified
by live probes, both in CollectFields' merge loop:

- The named fields and the spread merged together in connection order,
  so a same-key collision resolved by JS object key order — ['meta','*']
  let the spread win while ['*','meta'] let the named field win,
  contradicting the documented order-independence. The merge is now
  three passes — replace, named fields, spread — fixed by mapping kind,
  never by connection order.
- The spread's errors key interacted inconsistently with the error
  accumulation: silently discarded in the spread-only shape (the final
  overwrite), clobbering the whole accumulation in the replace+spread
  shape — a silent loss of diagnostics, the class the #48 no-silent-loss
  surface exists to surface. The spread now never owns errors: the
  errors key is excluded from the merge and the accumulation channels
  own the field, making both config shapes behave identically. The doc
  comment matches.

Plus the review's judgment call: an in-mapping value of '*' is rejected
at wrap time — the spread marker is out-mapping vocabulary, and the
in-side '*' would generate an extractor walking a literal '*' key and
failing at runtime.

Pinned: the connection-order independence (both config orders, same
result), the errors exclusion (both shapes, plus the error-port
append on the replace path under the terminal-event semantics), and the
wrap-time rejection. Suites: assembly-utils 47, assembly 49.
bergie added a commit that referenced this pull request Oct 19, 2026
The spread out-mapping and the dot-path field extraction (work document #35)
AsherBond pushed a commit to AsherBond/noflo that referenced this pull request Oct 20, 2026
… loud (work document noflo#48)

Implements the invariant the three-shape verification re-opened: the
Network must not lose messages silently under any scheduling. Three
surfaces, all engine-level and wire-safe (the 0x0f STRANDED tracefile
encoding stays bracket-shaped; the data-shaped entries ride the JS event
bus pending the freeze discussion):

- The closedown residue census: when the closedown predicate fires, the
  component's undeliverable data residue (per port, per scope, via the
  new InPort.strandedData()) is emitted as a component 'stranded' event
  and logged with named counts — the moment the strand became final,
  not a debug dump at shutdown. Standing IIP buffers are excluded:
  an unconsumed initial is configuration re-delivered per run (noflo#46),
  not stranded work.
- The control-stream replacement clobber: when a control port's
  latest-stream rule discards a buffered stream holding packets, the
  InPort dispatches a stranded report naming the discarded counts —
  the bang-vs-corpus hazard from the noflo-jekyll verification becomes
  diagnosable at the replacement moment instead of as a downstream
  strand.
- The unattached-outport send: a send into an outport with no attached
  sockets vanishes by contract, but the vanish now dispatches a
  stranded report and logs — the noflo#35 update noflo#18 footgun becomes visible.
  The component-side answer for legs that must not drop is
  required: true (escalates in checkRequired).

The Network forwards component stranded events onto its event bus;
bracket-shaped entries record to Flowtrace under the existing 0x0f
encoding, data-shaped entries stay on the JS surface. Three new
deterministic pins in spec/wd48-anomaly.js: the closedown census, the
replacement clobber, and the unattached-fail-leg drop.
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.

1 participant

0