Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Shutdown hook in RyukResourceReaper prevents a graceful shutdown with spring framework #8558

Open
jobayle opened this issue Apr 22, 2024 · 5 comments
Labels

Comments

@jobayle
Copy link

jobayle commented Apr 22, 2024

Module

Core

Testcontainers version

1.19.7

Using the latest Testcontainers version?

Yes

Host OS

Linux, Windows

Host Arch

x86_64

Docker version

Client:
 Cloud integration: v1.0.35+desktop.13
 Version:           26.0.0
 API version:       1.45
 Go version:        go1.21.8
 Git commit:        2ae903e
 Built:             Wed Mar 20 15:18:56 2024
 OS/Arch:           windows/amd64
 Context:           default

Server: Docker Desktop 4.29.0 (145265)
 Engine:
  Version:          26.0.0
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.8
  Git commit:       8b79278
  Built:            Wed Mar 20 15:18:01 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.28
  GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

What happened?

Dears,

With the introduction of this feature: #7717

The ryuk instance is terminated by a shutdown hook, therefore all containers are closed very early.

This prevents other shutdown hooks (eg: those set by the spring framework) to perform actions needed for a graceful shutdown that still require containers to be up.
Due to a retry mechanism in Spring's shutdown hook, it greatly increases the overall time to run tests!

Could you please revert this change or introduce a mean to disable this shutdown hook, thanks!

Relevant log output

No response

Additional Information

No response

@s-jepsen
Copy link

s-jepsen commented May 6, 2024

Will this be fixed any time soon?

@EAlf91
Copy link

EAlf91 commented May 7, 2024

Also relevant for #7871 there was a solution proposed in the issue as well

@jobayle
Copy link
Author

jobayle commented May 13, 2024

Hi @EAlf91, I cannot find the solution in the linked issue, could you please add a link to the specific comment? thanks!

@EAlf91
Copy link

EAlf91 commented May 14, 2024

@jobayle It's mentioned here: #7871 (comment) but it would require a change I guess. The author made the hook configurable via spring properties: alex-arana@a0fcbdf

I didn't try it myself and didn't see any way to configure this without using this fork. I'd highly appreciate to see a revert of #7717 or maybe using this way to configure it via spring properties

@jobayle
Copy link
Author

jobayle commented May 14, 2024

Thanks @EAlf91, but imho, this is not a viable solution if we have to maintain a patched version of testcontainers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants