Skip to content

run --local: start_logging so the attached log subscriber actually delivers - #41

Merged
ako merged 1 commit into
mainfrom
fix/runtime-log-start-logging
Jul 26, 2026
Merged

run --local: start_logging so the attached log subscriber actually delivers#41
ako merged 1 commit into
mainfrom
fix/runtime-log-start-logging

Conversation

@ako

@ako ako commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

Round 3 of findings #25. Round 2 (#39) registered a file log subscriber, but the Sudoku re-test showed runtime.log still only held the four JVM-banner lines — a probe microflow's log info/warning/error and a forced runtime exception produced zero lines.

Root cause (pinned by the findings doc's isolation test): a standalone runtime boots with the logging subsystem not started, so a registered subscriber sits inert — nothing is delivered until logging is activated.

Action Probe lines in runtime.log
Boot (mxcli attaches subscriber), then click 0
Call start_logging, then click 6

create_log_subscriber is necessary but not sufficient.

Fix

After create_log_subscriber, call the start_logging admin action in the same step (order: create subscriber → start_logging). An "already started" response is treated as success, because Start re-runs on the DB-update retry and restart paths against a still-running JVM. Still best-effort — a logging hiccup warns to stdout and never fails an otherwise-healthy start.

attachFileLogSubscriber → renamed configureRuntimeLogging since it now does both.

Tests

  • TestStart_StartLoggingAlreadyStartedIsSuccess — an "already started" response is silent and non-fatal.
  • TestStart_AttachesLogSubscriber now asserts the full [start, create_log_subscriber, start_logging] sequence.
  • TestStart_LogSubscriberFailureNonFatal unchanged (a failing create_log_subscriber short-circuits before start_logging).

Docker unit tests pass; CLI builds; go vet clean.

Note

Live end-to-end (probe microflow → 6 lines) was verified by the findings author on the Sudoku app; this change encodes exactly the start_logging call they identified. fix-issue.md records the round-3 diagnosis: when a registered sink receives nothing, check whether the subsystem feeding it is even running — registration ≠ activation.

🤖 Generated with Claude Code


Generated by Claude Code

…livers

Registering a file log subscriber (findings #25, round 2) was necessary but not
sufficient: a standalone runtime boots with the logging subsystem NOT started,
so the subscriber sits inert and receives nothing. runtime.log still held only
the JVM banner — a probe microflow's LOG output and a forced runtime exception
produced zero lines. The isolation test in the findings doc pins it exactly:
boot+subscriber → 0 probe lines; then call start_logging → 6 lines.

After create_log_subscriber, call the start_logging admin action in the same
step (order: create subscriber → start_logging). An "already started" response
is treated as success, because Start re-runs on the DB-update retry and restart
paths against a still-running JVM. Still best-effort — a logging hiccup warns to
stdout and never fails an otherwise-healthy start.

Renamed attachFileLogSubscriber → configureRuntimeLogging since it now does
both. Tests: TestStart_StartLoggingAlreadyStartedIsSuccess; TestStart_Attaches-
LogSubscriber now asserts the [start, create_log_subscriber, start_logging]
sequence.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
@ako
ako merged commit 5fb58db into main Jul 26, 2026
1 of 3 checks passed
ako pushed a commit that referenced this pull request Jul 29, 2026
Two entity-correctness fixes from the ledger project, both verified end-to-end on
Mendix 11.12.1.

#41 (CE6771 check gap): `create association from/to <ViewEntity>` passed
`mxcli check --references` and exec, but `mx check` rejects it — associations
to/from view entities are impossible. The reference checker now resolves both
endpoints and rejects when either `isViewEntity` (new helper), naming it and
pointing at a non-persistent alternative. Both directions caught.

#39 (mx check crash): a `create or modify entity` dropping an indexed attribute
left the index orphaned (its column referenced a removed GUID), and `mx check`
CRASHED loading the project with an unhandled AggregateException. Two parts:
- executor `reconcileDroppedIndexes`: when the statement lists no indexes, carry
  existing ones forward, pruning columns for dropped attributes (attr IDs survive
  by name) and dropping empty indexes — fixes partial drops (index(A,B)→index(A)).
- backend `UpdateEntity`: an untouched empty Indexes PartList is "clean", so the
  codec passes the raw orphan through; force it dirty (add+remove) so the codec
  re-emits an empty list, clearing the raw — fixes the all-removed case.
Verified: `mx check` → 0 errors (previously crashed).

Tests: TestIsViewEntity, TestReconcileDroppedIndexes. Examples + symptom table.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
ako pushed a commit that referenced this pull request Jul 29, 2026
…41)

A workflow `call microflow ... with (Name = ...)` mapping accepted a qualified
(Mod.Flow.Param) or quoted ("Param") name via the QualifiedName grammar rule and
stored its raw text. The executor then re-qualifies with `mfQN + "." + name`, so:

  - qualified input  Mod.Flow.Param  → stored Mod.Flow.Mod.Flow.Param → null
    ParameterId → runtime fails to load the model
  - quoted input     "Param"         → stored Mod.Flow."Param"        → CE1613
  - bare input       Param           → stored Mod.Flow.Param          → correct

Only the bare form worked — the one place MDL's "always quote identifiers" habit is
actively wrong. Normalize the mapping name in the visitor to the bare, unquoted last
segment so all three spellings converge on the correct single-qualified stored form.

Verified end to end: bare, quoted, and fully-qualified inputs all store
`MyFirstModule.ACT_Do.Item`. Unit test covers the normalizer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
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