Skip to content

Release 4.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 25 Apr 11:53

LittleForker 4.0.0

This is a major release with breaking API changes, new DI-friendly hosted services, and security hardening.

Breaking Changes

  • ProcessSupervisor constructor replaced — The multi-parameter constructor is removed. Use ProcessSupervisorSettings instead:
    var settings = new ProcessSupervisorSettings(workingDirectory, processPath)
    {
        Arguments = "...",
        EnvironmentVariables = ...,
        CaptureStdErr = true
    };
    var supervisor = new ProcessSupervisor(settings, loggerFactory);
  • ProcessRunType removed — The SelfTerminating / NonTerminating distinction is gone. All processes are supervised uniformly.
  • ExitedUnexpectedly state removed — The state machine is simplified. Processes that exit with a non-zero code enter ExitedWithError regardless of how they were stopped.
  • SelfTerminatingProcess sample project removed.
  • Nonce wire protocol changed — Security nonces are now validated over the wire protocol (EXIT {nonce}), not embedded in the pipe name. GetPipeName(int, string) is removed.

New Features

  • CooperativeShutdownHostedService — A BackgroundService that listens for cooperative shutdown signals and calls IHostApplicationLifetime.StopApplication(). Register via DI:
    services.AddCooperativeShutdownHostedService();
    // or with nonce:
    services.AddCooperativeShutdownHostedService(o => o.Nonce = "shared-secret");
  • WatchParentProcessHostedService — A BackgroundService that monitors a parent process and stops the application when it exits:
    services.AddWatchParentProcessHostedService(o => o.ParentProcessId = parentPid);
  • NonTerminatingProcess converted to Generic Host — The sample child process now uses Microsoft.Extensions.Hosting instead of Serilog.

Security

  • Pipe ACLs on Windows — Named pipe servers now restrict access to the current user via PipeSecurity, preventing other local users from sending EXIT signals.
  • Pipe squatting prevention — Pipe servers are limited to 1 instance, preventing malicious processes from creating competing server instances.
  • Nonce no longer discoverable — The security nonce is validated over the wire protocol instead of being embedded in the (enumerable) pipe name.

Infrastructure

  • Targets .NET 10
  • xUnit v3 with Microsoft Testing Platform
  • TreatWarningsAsErrors and EnforceCodeStyleInBuild enabled
  • .editorconfig and shared.props for consistent code style
  • File-scoped namespaces, nullable annotations, sealed classes throughout

Full Changelog: v3.0.1...v4.0.0