feat(launcher): prepare Campaign LA11 user gate
This commit is contained in:
parent
09d84387a8
commit
f881e5b467
24 changed files with 3538 additions and 58 deletions
|
|
@ -41,11 +41,10 @@ public interface ILauncherChildProcess : IDisposable
|
|||
/// documented project landmine; see CLAUDE.md
|
||||
/// "Logout-before-reconnect"). On Linux this sends SIGINT (K4 proved
|
||||
/// the headless host's SIGINT handler produces an ACE-confirmed
|
||||
/// graceful logout). On Windows there is no reliable cross-console
|
||||
/// mechanism for an arbitrary no-window child process today — see
|
||||
/// <c>docs/ISSUES.md</c> for the tracked gap and fix direction; this
|
||||
/// returns false there. Returns true only when the signal was
|
||||
/// actually delivered; never throws.
|
||||
/// graceful logout). On Windows, console-capable children are started
|
||||
/// as distinct process-group leaders and receive a targeted
|
||||
/// CTRL_BREAK_EVENT. Returns true only when the signal was actually
|
||||
/// delivered; never throws.
|
||||
/// </summary>
|
||||
bool TryRequestGracefulStop();
|
||||
|
||||
|
|
@ -72,7 +71,9 @@ public interface ILauncherChildProcessFactory
|
|||
public sealed class SystemChildProcessFactory : ILauncherChildProcessFactory
|
||||
{
|
||||
public ILauncherChildProcess Create(LauncherProcessSpec spec) =>
|
||||
new SystemChildProcess(spec);
|
||||
OperatingSystem.IsWindows() && spec.SupportsConsoleGracefulStop
|
||||
? new WindowsSystemChildProcess(spec)
|
||||
: new SystemChildProcess(spec);
|
||||
}
|
||||
|
||||
internal sealed partial class SystemChildProcess : ILauncherChildProcess
|
||||
|
|
@ -86,11 +87,13 @@ internal sealed partial class SystemChildProcess : ILauncherChildProcess
|
|||
private static partial int kill(int pid, int sig);
|
||||
|
||||
private readonly Process _process;
|
||||
private readonly bool _supportsConsoleGracefulStop;
|
||||
private bool _raisingEnabled;
|
||||
|
||||
internal SystemChildProcess(LauncherProcessSpec spec)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(spec);
|
||||
_supportsConsoleGracefulStop = spec.SupportsConsoleGracefulStop;
|
||||
|
||||
var startInfo = new ProcessStartInfo
|
||||
{
|
||||
|
|
@ -130,11 +133,11 @@ internal sealed partial class SystemChildProcess : ILauncherChildProcess
|
|||
|
||||
public bool TryRequestGracefulStop()
|
||||
{
|
||||
if (!OperatingSystem.IsLinux())
|
||||
if (!OperatingSystem.IsLinux() || !_supportsConsoleGracefulStop)
|
||||
{
|
||||
// No reliable cross-console mechanism exists for an
|
||||
// arbitrary no-window Windows child process — tracked gap,
|
||||
// see docs/ISSUES.md.
|
||||
// Windows console-capable children use
|
||||
// WindowsSystemChildProcess. Graphical/non-console children
|
||||
// deliberately retain the Process/WM_CLOSE path.
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue