{"id":33179031,"url":"https://github.com/timpeeters/spring-boot-graceful-shutdown","last_synced_at":"2026-01-11T17:02:52.253Z","repository":{"id":32660192,"uuid":"138378616","full_name":"timpeeters/spring-boot-graceful-shutdown","owner":"timpeeters","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-27T06:59:03.000Z","size":309,"stargazers_count":93,"open_issues_count":30,"forks_count":22,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-28T08:50:00.363Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timpeeters.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-23T06:55:04.000Z","updated_at":"2024-12-10T05:45:34.000Z","dependencies_parsed_at":"2023-02-17T02:55:19.637Z","dependency_job_id":null,"html_url":"https://github.com/timpeeters/spring-boot-graceful-shutdown","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/timpeeters/spring-boot-graceful-shutdown","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timpeeters%2Fspring-boot-graceful-shutdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timpeeters%2Fspring-boot-graceful-shutdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timpeeters%2Fspring-boot-graceful-shutdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timpeeters%2Fspring-boot-graceful-shutdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timpeeters","download_url":"https://codeload.github.com/timpeeters/spring-boot-graceful-shutdown/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timpeeters%2Fspring-boot-graceful-shutdown/sbom","scorecard":{"id":886671,"data":{"date":"2025-08-11","repo":{"name":"github.com/timpeeters/spring-boot-graceful-shutdown","commit":"6db79270990fae65fd8ef516fc25b1d3e2c6ac41"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: .mvn/wrapper/maven-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/10 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/timpeeters/spring-boot-graceful-shutdown/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/timpeeters/spring-boot-graceful-shutdown/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/timpeeters/spring-boot-graceful-shutdown/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/timpeeters/spring-boot-graceful-shutdown/ci.yaml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":10,"reason":"SAST tool detected","details":["Info: SAST configuration detected: Sonar","Warn: 0 commits out of 20 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"14 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-cm59-pr5q-cw85","Warn: Project is vulnerable to: GHSA-rc42-6c7j-7h5r","Warn: Project is vulnerable to: GHSA-xf96-w227-r7c4","Warn: Project is vulnerable to: GHSA-36p3-wjmg-h94x","Warn: Project is vulnerable to: GHSA-hh26-6xwr-ggv7","Warn: Project is vulnerable to: GHSA-4gc7-5j7h-4qph","Warn: Project is vulnerable to: GHSA-4wp7-92pw-q264","Warn: Project is vulnerable to: GHSA-g5mm-vmx4-3rg7","Warn: Project is vulnerable to: GHSA-6gf2-pvqw-37ph","Warn: Project is vulnerable to: GHSA-rfmp-97jj-h8m6","Warn: Project is vulnerable to: GHSA-558x-2xjg-6232","Warn: Project is vulnerable to: GHSA-564r-hj7v-mcr5","Warn: Project is vulnerable to: GHSA-9cmq-m9j5-mvww","Warn: Project is vulnerable to: GHSA-wxqc-pxw9-g2p8"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T10:16:38.163Z","repository_id":32660192,"created_at":"2025-08-24T10:16:38.163Z","updated_at":"2025-08-24T10:16:38.163Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28314260,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T14:58:17.114Z","status":"ssl_error","status_checked_at":"2026-01-11T14:55:53.580Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-11-16T03:00:36.817Z","updated_at":"2026-01-11T17:02:52.248Z","avatar_url":"https://github.com/timpeeters.png","language":"Java","funding_links":[],"categories":["容错组件"],"sub_categories":[],"readme":"Spring Boot Graceful Shutdown\n=============================\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.timpeeters/spring-boot-graceful-shutdown/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.timpeeters/spring-boot-graceful-shutdown)\n\nThis project adds graceful shutdown behavior to Spring Boot. \n\n\u003e :warning:  As of Spring Boot 2.3+, use the native support inside Spring Boot to accomplish graceful shutdown: https://docs.spring.io/spring-boot/docs/current/reference/html/web.html#web.graceful-shutdown. Additionally, when deployed on Kubernetes, add a preStop command:\nhttps://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.cloud.kubernetes.container-lifecycle\n\nVersions\n--------\n\nMultiple branches are maintained to support multiple Spring Boot versions.\nThe following tables show the relation between the Spring Boot version and the Spring Boot Graceful Shutdown version.\n\n| Spring Boot | Spring Boot Graceful Shutdown | Branch |\n| :---        | :---                          | :---   |\n| 1.5.x       | 1.0.x                         | 1.0.x  |\n| 2.0.x       | 2.0.x                         | 2.0.x  |\n| 2.1.x       | 2.1.x                         | 2.1.x  |\n| 2.2.x       | 2.2.x                         | master |\n\n\nFlow\n----\n\n1. The JVM receives the SIGTERM signal and starts shutting down the Spring container.\n2. A Spring EventListener listens for a ContextClosedEvent and is invoked once the shutdown is started.\n3. The EventListener updates a Spring Boot HealthIndicator and puts it \"out of service\".\n5. The context shutdown is delayed using a Thread.sleep to allow the load balancer to see the updated HealthIndicator status and stop forwarding requests to this instance.\n7. When the Thread.sleep is finished, the Tomcat container is gracefully shutdown. \nFirst by pausing the connector, no longer accepting new request.\nNext, by allowing the Tomcat thread pool a configurable amount of time to finish the active threads.\n8. Finally, the Spring context is closed.\n\n\nLimitations\n-----------\n\nCurrently this project only supports Tomcat as embedded web container for Spring Boot. \nUndertow and/or Jetty are not yet supported.\n\n\nInstallation\n------------\n\n1. Add the following Maven dependency:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.timpeeters\u003c/groupId\u003e\n    \u003cartifactId\u003espring-boot-graceful-shutdown\u003c/artifactId\u003e\n    \u003cversion\u003eX.X.X\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n\nConfiguration\n-------------\n\n| Key                       | Default value  | Description |\n| ------------------------- | -------------- | ----------- |\n| graceful.shutdown.enabled | false          | Indicates whether graceful shutdown is enabled or not. | \n| graceful.shutdown.timeout | 60s            | The time to wait for active threads to finish before shutting down the Tomcat connector. |\n| graceful.shutdown.wait    | 30s            | The time to return \"out of service\" on the health page before starting the graceful shutdown. |\n\nIt is important to specify the time unit, otherwise you end up with milliseconds.\n\nAlternative implementations\n---------------------------\n\nWe found several alternatives for graceful shutdown behavior in Spring Boot. \n\n- https://github.com/SchweizerischeBundesbahnen/springboot-graceful-shutdown\n- https://github.com/corentin59/spring-boot-graceful-shutdown\n- https://github.com/gesellix/graceful-shutdown-spring-boot\n\n\nReferences\n----------\n\n- https://github.com/spring-projects/spring-boot/issues/4657\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimpeeters%2Fspring-boot-graceful-shutdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimpeeters%2Fspring-boot-graceful-shutdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimpeeters%2Fspring-boot-graceful-shutdown/lists"}