Skip to content

telemetry: emit a cancellation event on Ctrl-C / console-close / shutdown #563

Description

@RamonArjona4

Description of the new feature / enhancement

The SetConsoleCtrlHandler(dacl_ctrl_handler) path (src/core/wxc/src/main.rs ~line 431) handles DACL cleanup on Ctrl-C / Ctrl-Break / console-close / logoff / shutdown, then yields to the default handler which calls ExitProcess — bypassing emit_completion. User cancellation of a long run, or host shutdown/logoff, currently produces no telemetry.

Emit a single "cancelled/terminated" event from the handler so these terminations are observable.

Proposed technical implementation details

  • From dacl_ctrl_handler, emit one MXC.Execution/MXC.Error with a Cancelled outcome/reason before yielding to the default handler.
  • Keep the handler minimal: the OS gives a tight time budget (~5s on shutdown), so do minimal, allocation-light work; the provider must already be registered (telemetry active).
  • ETW writes are fast and synchronous, which suits the constrained handler context.

Deferred from PR #493.

Metadata

Metadata

Assignees

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions