Skip to content

Fix graceful shutdown of containers fixes #947#3890

Closed
tnichols217 wants to merge 1 commit intosylabs:mainfrom
tnichols217:main
Closed

Fix graceful shutdown of containers fixes #947#3890
tnichols217 wants to merge 1 commit intosylabs:mainfrom
tnichols217:main

Conversation

@tnichols217
Copy link
Copy Markdown

Description of the Pull Request (PR):

Handles the SIGTERM signal to the starter binary such that containers have a chance to gracefully shut down, especially when run through a system service. Should fix issue #947, ableit a slightly different approach than what was described in the issue. This also allows us to properly close and stop mounts before we get SIGKILLed by the service if relevant.

This fixes or addresses the following GitHub issues:

Before submitting a PR, make sure you have done the following:

Done all of the above except writing tests, may need help with this as this is my first time contributing Go. This PR should also be squashed before merging.

Copy link
Copy Markdown
Member

@dtrudg dtrudg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the attempted fix. Haven't had a chance to look into it in depth, but from the test failures, something isn't quite right.

The e2e tests are now timing out...

https://circleci.com/api/v1.1/project/github/sylabs/singularity/95681/output/120/0?file=true&allocation-id=6934a4e7b179c815fcd70cf7-0-build%2FABCDEFGH

Given that there's a RunSingularity call blocked for 29 minutes, it looks like the change is causing a deadlock for a / some tests...

goroutine 297 [chan receive, 29 minutes]:
testing.(*T).Run(0xc00080e000, {0xc000586ae0, 0x14}, 0xc0004a1bf0)
	testing/testing.go:2005 +0x9fe
github.com/sylabs/singularity/v4/e2e/internal/e2e.TestEnv.RunSingularity({{0xc00043b100, 0x1a}, {0xc000a40540, 0x1e}, {0xc0008b7290, 0x2b}, {0xc0008b72c0, 0x2f}, {0x0, 0x0}, ...}, ...)
	github.com/sylabs/singularity/v4/e2e/internal/e2e/singularitycmd.go:686 +0x45d
github.com/sylabs/singularity/v4/e2e/inspect.ctx.singularityInspect({{{0xc00043b100, 0x1a}, {0xc000a40540, 0x1e}, {0xc0008b7290, 0x2b}, {0xc0008b72c0, 0x2f}, {0x0, 0x0}, ...}}, ...)
	github.com/sylabs/singularity/v4/e2e/inspect/inspect.go:353 +0x2a50
github.com/sylabs/singularity/v4/e2e/internal/testhelper.(*Suite).Run.func1.1.1(0xc00080e000)
	github.com/sylabs/singularity/v4/e2e/internal/testhelper/testhelper.go:91 +0x3f
testing.tRunner(0xc00080e000, 0xc00005cc10)
	testing/testing.go:1934 +0x21d
created by testing.(*T).Run in goroutine 339
	testing/testing.go:1997 +0x9d3

@dtrudg
Copy link
Copy Markdown
Member

dtrudg commented Feb 20, 2026

I'll close this as there hasn't been any follow up. Underlying issue is still tracked, and please feel to re-open if you do any further work as above.

@dtrudg dtrudg closed this Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

singularity not cleanup crypt when signal terminated

2 participants