Closed afscrome closed 1 month ago
You can also see this hang if you indirectly wait on the server. Here the database is waiting on the migrator, which is in turn waiting on the sql server.
var sql = builder.AddSqlServer("sql")
.WithLifetime(ContainerLifetime.Persistent);
var migrator = builder.AddExecutable("migrator", "pwsh", ".",
"-NoProfile",
"-NoLogo",
"-NonInteractive",
"-Command",
"Write-Host 'Starting Migration'; Start-Sleep -Seconds 10; Write-Host 'Done'")
.WaitFor(sql);
var db = sql.AddDatabase("mydb")
.WaitFor(migrator);
Is there an existing issue for this?
Describe the bug
Running the following causes the sql server resource to hang on startup indefinitely.
Console logs don't show anything, nor is any container showing up with
docker ps
so it seems something is failing before even trying to start the container.Expected Behavior
The SQL Server resource should start.
Or if for some reason the
WaitFor
here is not supported, I'd expect to see it throw an exception rather than just hang.Steps To Reproduce
Both of the following will repro. Commenting out the
db.WaitFor(sql/postgres)
line will stop the hang. SQL:Or Postgres:
Exceptions (if any)
No response
.NET Version info
Anything else?
No response