Skip to content

Abruptly closed Session prevents restart #40997

Description

@hultqvist

Windows Version

Microsoft Windows [Version 10.0.26200.8655]

WSL Version

2.9.3.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

WSLC

Distro Version

WSLC

Other Software

NuGet: Microsoft.WSL.Containers 2.9.3

Repro Steps

  1. Put a breakpoint at the exception
  2. When hitting the breakpoint, stop the project, don't allow it to dispose or terminate.
  3. Start the program again
var sessionSettings = new SessionSettings("BugSession", Config.RootDataPath)
{
    CpuCount = 2,
    MemorySizeInMB = 2048,
};
using var session = new Session(sessionSettings);
try
{
    session.Start();
    
    foreach(var img in session.GetImages())
        Console.WriteLine(img.Name);
    
    throw new NotImplementedException();
}
finally
{
    session.Terminate();
}

Expected Behavior

Connect to the existing session or force close and start a new one.

Actual Behavior

Upon the second run, after the abrupt stop, I get the following error message.

System.Runtime.InteropServices.COMException: 'Cannot create a file when that file already exists.

Cannot create a file when that file already exists.
'

Diagnostic Logs

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions