-
Notifications
You must be signed in to change notification settings - Fork 61
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
fix(core): Handle SIGTERM
for graceful shutdowns
#16882
base: main
Are you sure you want to change the base?
Conversation
Warning Rate limit exceeded@andes-it has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 17 minutes and 47 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (22)
WalkthroughThe pull request introduces a new function, Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Datadog ReportAll test runs ✅ 10 Total Test Services: 0 Failed, 10 Passed Test ServicesThis report shows up to 10 services
🔻 Code Coverage Decreases vs Default Branch (4) |
SIGTERM
for graceful shutdownsSIGTERM
for graceful shutdowns
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was checking the other day and I'm not sure if any of our servers are using infra-express-server
. It might have been a blueprint which went unused.
I also think this SIGTERM handling is worse then the current SIGKILL fallback. There's nothing graceful about process.exit(0)
. Afaik it will just abruptly exit the process and close all open connections, resulting in socket issues.
Currently at least there's a chance that current requests finish and the load balancer stops sending new requests to the pod before its eventual SIGKILL. 🤔
db27f92
to
97d6a57
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (11)
libs/node/utils/src/lib/setupShutdownHooks.ts (3)
8-14
: Consider adding SIGQUIT signal handlerWhile the current signal handling covers the most common scenarios, consider adding
SIGQUIT
for complete signal coverage, especially in Unix-like environments.- const terminationEvents = ['SIGHUP', 'SIGINT', 'SIGTERM'] + const terminationEvents = ['SIGHUP', 'SIGINT', 'SIGTERM', 'SIGQUIT']
37-39
: Consider cleanup of signal handlersWhile the current implementation works, it's good practice to clean up signal handlers when the server closes to prevent memory leaks in long-running applications that might restart the server.
+ const cleanupListeners = () => { + for (const signal of terminationEvents) { + process.removeListener(signal, () => shutdown(signal)) + } + } + for (const signal of terminationEvents) { process.on(signal, () => shutdown(signal)) } + + server.on('close', cleanupListeners)
1-40
: Add comprehensive documentation and testing guidelinesAs this is a critical utility function in the shared library, consider:
- Adding JSDoc documentation with examples
- Creating integration tests with different signal scenarios
- Documenting recommended usage patterns in the README
This will help other developers properly integrate the shutdown hooks in their services.
libs/node/utils/README.md (3)
9-10
: Improve parameter documentation clarityThe
onShutdown
parameter description should be restructured for better clarity.-- `onShutdown` (Function): Optional callback function that will be executed before the server shuts down. Can be used to perform and wait for other cleanup tasks before the server shuts down. ++ `onShutdown` (Function): Optional callback function that will be executed before the server shuts down. It can be used to perform and wait for other cleanup tasks.🧰 Tools
🪛 LanguageTool
[style] ~10-~10: To form a complete sentence, be sure to include a subject.
Context: ... executed before the server shuts down. Can be used to perform and wait for other c...(MISSING_IT_THERE)
16-20
: Add error handling details to behavior documentationThe behavior section should include information about error handling scenarios and potential error types.
Consider adding the following details:
- Types of errors that might occur during shutdown
- How errors are propagated
- Whether the
onShutdown
callback errors are caught and handled
22-24
: Enhance testing documentationThe testing section would benefit from examples of specific test cases that users should implement.
Consider adding:
- Test scenarios for different termination signals
- Examples of mocking the server and shutdown process
- Test cases for error conditions
- Examples of testing the
onShutdown
callback functionalitylibs/infra-express-server/src/lib/infra-express-server.ts (1)
69-72
: Consider enhancing the error handler implementationWhile the parameter naming is correct, the error handler could benefit from improvements:
+interface ApiError extends Error { + status?: number; +} app.use(function errorHandler( - err: any, + err: ApiError, _req: Request, res: Response, _next: NextFunction, ) { logger.error(`Status code: ${err.status}, msg: ${err.message}`) res.status(err.status || 500) - res.send(err.message) + res.json({ + error: { + message: err.message, + status: err.status || 500 + } + }) }libs/infra-nest-server/src/lib/bootstrap.ts (1)
49-51
: Consider documenting shutdown behavior with keep-alive connections.While the implementation is correct, the interaction between the 30-second
KEEP_ALIVE_TIMEOUT
and shutdown signals could affect shutdown timing. Long-lived connections might delay the shutdown process.Consider:
- Adding a comment documenting this interaction
- Implementing a maximum shutdown timeout
- Logging when shutdown is initiated and completed
Here's a suggested comment addition:
// Handle signals like SIGINT, SIGTERM and SIGHUP gracefully. + // Note: Active keep-alive connections (timeout: 30s) may delay shutdown app.enableShutdownHooks()
Also applies to: 18-19
libs/node/utils/src/lib/setupShutdownHooks.spec.ts (3)
18-37
: Enhance type safety in test setup.While the test setup is comprehensive, consider improving type safety:
- server = { - close: jest.fn((callback) => callback()), - } as unknown as Server + server = { + close: jest.fn((callback?: (err?: Error) => void) => { + if (callback) callback(); + return server; + }), + } as Partial<Server> as Server
39-86
: Consider extracting common test patterns.The signal handler extraction is repeated across multiple tests. Consider creating a helper function:
const getSignalHandler = (signal: string, spy: jest.SpyInstance): Function => { return spy.mock.calls.find(([event]) => event === signal)[1]; };
88-151
: Comprehensive error handling test coverage.The test cases thoroughly cover error scenarios and callback handling. Great job on including both successful and failure paths for the onShutdown callback.
However, consider adding one more test case:
it('should handle multiple signals in sequence', async () => { setupShutdownHooks(server); const sigTermHandler = getSignalHandler('SIGTERM', processOnSpy); const sigIntHandler = getSignalHandler('SIGINT', processOnSpy); await sigTermHandler(); await sigIntHandler(); expect(server.close).toHaveBeenCalledTimes(1); // Should only close once expect(processExitSpy).toHaveBeenCalledTimes(1); });
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (14)
libs/infra-express-server/src/lib/infra-express-server.ts
(5 hunks)libs/infra-nest-server/src/lib/bootstrap.ts
(1 hunks)libs/infra-next-server/src/lib/bootstrap.ts
(2 hunks)libs/node/utils/.eslintrc.json
(1 hunks)libs/node/utils/README.md
(1 hunks)libs/node/utils/jest.config.ts
(1 hunks)libs/node/utils/project.json
(1 hunks)libs/node/utils/src/index.ts
(1 hunks)libs/node/utils/src/lib/setupShutdownHooks.spec.ts
(1 hunks)libs/node/utils/src/lib/setupShutdownHooks.ts
(1 hunks)libs/node/utils/tsconfig.json
(1 hunks)libs/node/utils/tsconfig.lib.json
(1 hunks)libs/node/utils/tsconfig.spec.json
(1 hunks)tsconfig.base.json
(1 hunks)
✅ Files skipped from review due to trivial changes (7)
- libs/node/utils/.eslintrc.json
- libs/node/utils/jest.config.ts
- libs/node/utils/project.json
- libs/node/utils/src/index.ts
- libs/node/utils/tsconfig.json
- libs/node/utils/tsconfig.lib.json
- libs/node/utils/tsconfig.spec.json
🚧 Files skipped from review as they are similar to previous changes (1)
- libs/infra-next-server/src/lib/bootstrap.ts
🧰 Additional context used
📓 Path-based instructions (5)
libs/infra-express-server/src/lib/infra-express-server.ts (1)
Pattern libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/infra-nest-server/src/lib/bootstrap.ts (1)
Pattern libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/node/utils/README.md (1)
Pattern libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/node/utils/src/lib/setupShutdownHooks.spec.ts (1)
Pattern libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/node/utils/src/lib/setupShutdownHooks.ts (1)
Pattern libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
🪛 LanguageTool
libs/node/utils/README.md
[style] ~10-~10: To form a complete sentence, be sure to include a subject.
Context: ... executed before the server shuts down. Can be used to perform and wait for other c...
(MISSING_IT_THERE)
🔇 Additional comments (9)
libs/node/utils/src/lib/setupShutdownHooks.ts (1)
1-7
: LGTM! Well-structured function signature with proper typing
The function signature is well-designed with TypeScript types and an optional callback for custom cleanup operations.
libs/node/utils/README.md (1)
14-15
: Verify NX runner detection implementation
The documentation mentions NX runner detection using an environment variable. Let's verify this implementation.
✅ Verification successful
Let me gather more context about the implementation to ensure a complete verification.
NX runner detection and disconnect event handling are correctly implemented
The implementation in setupShutdownHooks.ts
accurately matches the documentation:
- Checks for NX runner using
process.env.NX_INVOKED_BY_RUNNER === 'true'
- Adds 'disconnect' event to termination events when running under NX
- Implementation is well-tested with dedicated test cases verifying this behavior
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for the NX runner environment variable usage
rg -A 2 "NX_INVOKED_BY_RUNNER"
# Look for the disconnect event handler implementation
ast-grep --pattern 'process.on("disconnect"'
Length of output: 1216
Script:
#!/bin/bash
# Get the full implementation of setupShutdownHooks
cat libs/node/utils/src/lib/setupShutdownHooks.ts
# Get the full test implementation
cat libs/node/utils/src/lib/setupShutdownHooks.spec.ts
Length of output: 5125
libs/infra-express-server/src/lib/infra-express-server.ts (3)
45-50
: LGTM! Parameter naming follows best practices
The underscore prefix for unused parameters follows TypeScript conventions and improves code clarity.
88-88
: Verify graceful shutdown behavior
The addition of setupShutdownHooks
addresses the PR objective, but we should verify it properly handles in-flight requests during shutdown.
✅ Verification successful
Graceful shutdown implementation is properly handled
The setupShutdownHooks
implementation correctly handles in-flight requests by:
- Using
server.close()
which waits for existing connections to complete before shutting down - Preventing multiple shutdown attempts with the
isShuttingDown
flag - Supporting custom cleanup through the optional
onShutdown
callback - Properly handling termination signals (SIGHUP, SIGINT, SIGTERM)
- Logging shutdown progress and errors for observability
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if setupShutdownHooks properly handles in-flight requests
# Look for timeout configurations and request handling during shutdown
ast-grep --pattern 'setupShutdownHooks($_) {
$$$
}'
Length of output: 55
Script:
#!/bin/bash
# Search for setupShutdownHooks function definition
rg -A 10 "setupShutdownHooks" --type ts
Length of output: 10770
Script:
#!/bin/bash
# Get the full implementation of setupShutdownHooks
cat libs/node/utils/src/lib/setupShutdownHooks.ts
Length of output: 1102
1-1
: Verify the implementation of setupShutdownHooks
Let's ensure the imported function properly handles graceful shutdowns.
✅ Verification successful
Implementation of setupShutdownHooks is properly integrated
The implementation is well-tested and correctly used in the Express server:
- Handles standard termination signals (SIGHUP, SIGINT, SIGTERM)
- Includes special handling for NX runner environments
- Provides graceful shutdown with proper server closure
- Supports optional cleanup through onShutdown callback
- Correctly integrated at the end of runServer function
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check the implementation of setupShutdownHooks
# Look for the implementation and documentation
fd -e md -e ts "node-utils" | xargs rg -l "setupShutdownHooks"
Length of output: 314
Script:
#!/bin/bash
# Check the implementation and documentation of setupShutdownHooks
echo "=== Implementation of setupShutdownHooks ==="
ast-grep --pattern 'export function setupShutdownHooks($_) { $$$ }'
echo -e "\n=== README Documentation ==="
cat libs/node/utils/README.md
echo -e "\n=== Test Cases ==="
cat libs/node/utils/src/lib/setupShutdownHooks.spec.ts
Length of output: 5686
Script:
#!/bin/bash
# Check the actual implementation file and usage in express server
echo "=== Implementation File ==="
cat libs/node/utils/src/lib/setupShutdownHooks.ts
echo -e "\n=== Usage in Express Server ==="
rg -A 5 "setupShutdownHooks" libs/infra-express-server/src/lib/infra-express-server.ts
Length of output: 1709
libs/infra-nest-server/src/lib/bootstrap.ts (2)
49-51
: LGTM! Graceful shutdown implementation follows best practices.
The addition of app.enableShutdownHooks()
properly implements signal handling for graceful shutdowns, which aligns with the PR objectives. This ensures that the application can properly clean up resources and complete ongoing requests before terminating.
49-51
: Verify shutdown cleanup in the close method.
The close
method handles cleanup of both the main app and metrics server. Let's verify it properly awaits all cleanup operations.
Also applies to: 156-164
✅ Verification successful
Shutdown cleanup is properly implemented
The close method correctly handles the cleanup by:
- Awaiting the NestJS application shutdown with
app.close()
- Properly closing the metrics server using a Promise-based approach
- Following the correct order: first app, then metrics server
- Using
enableShutdownHooks()
to handle system signals appropriately
The implementation ensures all resources are cleaned up gracefully during shutdown.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for potential shutdown-related issues in the codebase
# Look for other cleanup operations that might need to be included
rg -A 5 "beforeApplicationShutdown|onApplicationShutdown|close\(\)" --type typescript
# Check for any custom shutdown hooks that might need coordination
ast-grep --pattern 'app.enableShutdownHooks()'
Length of output: 810
Script:
#!/bin/bash
# Let's check the close method implementation and any shutdown hooks
ast-grep --pattern 'close() {
$$$
}'
# Also check for any beforeApplicationShutdown or onApplicationShutdown implementations
ast-grep --pattern 'beforeApplicationShutdown() {
$$$
}'
ast-grep --pattern 'onApplicationShutdown() {
$$$
}'
# Let's also check the specific file for the close method
cat libs/infra-nest-server/src/lib/bootstrap.ts
Length of output: 4705
libs/node/utils/src/lib/setupShutdownHooks.spec.ts (1)
1-11
: LGTM! Clean test setup with proper mocking.
The test setup follows best practices with clear imports and focused mocking of the logger functionality.
tsconfig.base.json (1)
956-956
: LGTM! Path mapping correctly configured for node-utils module.
The new path mapping for @island.is/node-utils
is properly configured and aligns with the PR's objective of implementing graceful shutdowns.
Let's verify the module's usage:
✅ Verification successful
Path mapping correctly configured and actively used in the codebase
The verification confirms that:
- The
@island.is/node-utils
module is properly imported in two server implementations:libs/infra-next-server/src/lib/bootstrap.ts
libs/infra-express-server/src/lib/infra-express-server.ts
- The implementation file exists at the correct location:
libs/node/utils/src/lib/setupShutdownHooks.ts
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the usage of @island.is/node-utils module
# Expected: Find imports of setupShutdownHooks from this module
# Search for imports of the module
rg "from ['|\"]@island\.is/node-utils['|\"]"
# Search for the implementation file
fd "setupShutdownHooks.ts" "libs/node/utils/src"
Length of output: 363
@eirikurn, hmm 🤔 Having forceful teardowns of connections this way is only marginally better than the current situation. Pods in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work 👏
…e-app,web,api-domains-secondary-school,api,application-template-api-modules,application-system-api,api-domains-application,application-templates-secondary-school,application-template-loader,application-system-form,application-ui-shell,clients-secondary-school,clients-ultraviolet-radiation,clients-statistics,api-domains-statistics,cms,api-domains-icelandic-government-institution-vacancies,api-domains-university-careers,api-domains-university-gateway,api-domains-social-insurance,api-domains-license-service,api-domains-communications,api-domains-content-search,api-domains-notifications,api-domains-email-signup,air-discount-scheme-api,content-search-indexer,services-search-indexer,api-domains-auth,api-domains-auth-admin,api-domains-sessions,cms-translations,api-domains-occupational-licenses-v2,services-user-notification,clients-user-notification,api-domains-law-and-order,application-api-history,judicial-system-backend,api-domains-vehicles,judicial-system-api,infra-express-server,infra-nest-server,services-auth-personal-representative-public,services-auth-personal-representative,judicial-system-digital-mailbox-api,regulations-admin-backend,clients-regulations-admin,api-domains-regulations-admin,download-service,icelandic-names-registry-backend,services-auth-delegation-api,clients-auth-delegation-api,services-user-profile,clients-user-profile,api-domains-user-profile,services-auth-ids-api,air-discount-scheme-backend,clients-air-discount-scheme,api-domains-air-discount-scheme,services-university-gateway,clients-university-gateway-api,application-templates-university,services-endorsements-api,api-domains-endorsement-system,services-auth-public-api,clients-auth-public-api,judicial-system-xrd-api,services-auth-admin-api,clients-auth-admin-api,financial-aid-open-api,financial-aid-backend,clients-municipalities-financial-aid,api-domains-municipalities-financial-aid,license-api,services-form-system,services-documents,api-domains-document-provider,clients-document-provider,financial-aid-api,reference-backend,services-sessions,clients-sessions,skilavottord-ws,clients-car-recycling,services-bff,testing-nest,services-auth-testing,auth-api-lib,nest-problem,application-api-payment,application-types,application-templates-social-insurance-administration-additional-support-for-the-elderly,application-templates-transport-authority-order-vehicle-registration-certificate,application-templates-social-insurance-administration-household-supplement,system-e2e,application-templates-transport-authority-digital-tachograph-workshop-card,application-templates-transport-authority-digital-tachograph-company-card,application-templates-transport-authority-digital-tachograph-drivers-card,application-templates-social-insurance-administration-pension-supplement,application-templates-transport-authority-anonymity-in-vehicle-registry,application-templates-transport-authority-transfer-of-vehicle-ownership,application-templates-parliamentary-list-creation,application-templates-parliamentary-list-signing,application-templates-presidential-list-creation,application-templates-social-insurance-administration-old-age-pension,application-templates-transport-authority-order-vehicle-license-plate,application-templates-presidential-list-signing,application-templates-social-insurance-administration-death-benefits,application-templates-transport-authority-change-co-owner-of-vehicle,application-templates-transport-authority-change-operator-of-vehicle,fiancial-statement-individual-election,application-templates-children-residence-change-v2,application-templates-social-insurance-administration-income-plan,application-templates-transport-authority-license-plate-renewal,application-templates-inao-financial-statement-political-party,application-templates-directorate-of-immigration-citizenship,application-templates-driving-license-book-update-instructor,application-templates-social-insurance-administration-core,application-templates-parental-leave,application-templates-aosh-transfer-of-machine-ownership,financial-statement-cemetery,application-templates-complaints-to-althingi-ombudsman,application-templates-driving-instructor-registrations,application-templates-aosh-work-accident-notification,application-templates-aosh-change-machine-supervisor,application-templates-european-health-insurance-card,application-templates-healthcare-license-certificate,application-templates-document-provider-onboarding,application-templates-health-insurance-declaration,application-templates-aosh-request-for-inspection,application-templates-driving-assessment-approval,application-templates-driving-school-confirmation,application-templates-funding-government-projects,application-templates-official-journal-of-iceland,application-templates-aosh-register-new-machine,application-templates-data-protection-complaint,application-templates-driving-license-duplicate,application-templates-financial-statements-inao,application-templates-institution-collaboration,application-templates-aosh-street-registration,application-templates-grindavik-housing-buyout,application-templates-public-debt-payment-plan,application-templates-aosh-deregister-machine,application-templates-driving-learners-permit,application-templates-general-fishing-license,application-templates-alcohol-tax-redemption,application-templates-healthcare-work-permit,application-templates-accident-notification,application-templates-announcement-of-death,application-templates-mortgage-certificate,application-templates-family-matters-core,application-templates-marriage-conditions,application-templates-no-debt-certificate,application-templates-inheritance-report,application-templates-new-primary-school,application-templates-passport-annulment,application-templates-reference-template,application-templates-operating-license,application-templates-general-petition,application-templates-health-insurance,application-templates-criminal-record,application-templates-driving-license,application-templates-example-payment,application-templates-car-recycling,application-templates-financial-aid,application-templates-login-service,application-templates-energy-funds,application-templates-home-support,portals-admin-application-system,portals-admin,application-templates-passport,application-templates-id-card,portals-my-pages-applications,service-portal,application-templates-estate,application-templates-p-sign,application-ui-components,application-ui-fields,island-ui-storybook,application-api-files,clients-charge-fjs-v2,api-domains-payment,application-utils,application-api-core,application-ui-forms,application-testing,application-core,api-mocks,air-discount-scheme-web,skilavottord-web,nest-swagger,infra-next-server,financial-aid-web-veita,financial-aid-web-osk,financial-aid-web-osk-e2e,consultation-portal,judicial-system-web,reference-next-app,contentful-apps,auth-admin-web,node-utils,contentful-role-permissions,services-contentful-entry-tagger,judicial-system-message-handler,judicial-system-scheduler,external-contracts-tests,services-xroad-collector,github-actions-cache,auth-shared,portals-admin-ids-admin,portals-admin-service-desk,clients-university-application-agricultural-university-of-iceland,clients-university-application-iceland-university-of-the-arts,api-domains-administration-of-occupational-safety-and-health,clients-transport-authority-digital-tachograph-drivers-card,api-domains-transport-authority,clients-administration-of-occupational-safety-and-health,clients-university-application-university-of-akureyri,clients-university-application-university-of-iceland,clients-university-application-bifrost-university,clients-university-application-holar-university,api-domains-financial-statement-individual-election,api-domains-official-journal-of-iceland-application,clients-health-insurance,api-domains-health-insurance,clients-university-application-reykjavik-university,clients-icelandic-government-institution-vacancies,clients-transport-authority-vehicle-plate-ordering,clients-transport-authority-vehicle-plate-renewal,clients-rights-portal,api-domains-rights-portal,clients-license-client,license,clients-transport-authority-vehicle-owner-change,clients-transport-authority-vehicle-operators,clients-official-journal-of-iceland-application,clients-transport-authority-vehicle-codetables,clients-transport-authority-vehicle-infolocks,portals-my-pages-education-student-assessment,portals-my-pages-education-career,portals-my-pages-education,portals-my-pages-social-insurance-maintenance,clients-transport-authority-vehicle-printing,clients-official-journal-of-iceland,api-domains-official-journal-of-iceland,api-domains-financial-statement-cemetery,clients-district-commissioners-licenses,clients-social-insurance-administration,api-domains-housing-benefit-calculator,portals-admin-icelandic-names-registry,portals-my-pages-occupational-licenses,api-domains-financial-statements-inao,clients-ums-cost-of-living-calculator,api-domains-umbodsmadur-skuldara,portals-my-pages-signature-collection,portals-my-pages-information,api-domains-icelandic-names-registry,api-domains-national-registry-x-road,api-domains-driving-license,api-domains-driving-license-book,api-domains-identity,api-domains-intellectual-properties,clients-directorate-of-immigration,clients-housing-benefit-calculator,portals-admin-signature-collection,portals-my-pages-education-license,portals-shared-modules-delegations,delegation-admin,api-domains-directorate-of-labour,api-domains-occupational-licenses,api-domains-watson-assistant-chat,clients-data-protection-complaint,clients-financial-statements-inao,portals-admin-air-discount-scheme,portals-my-pages-education-degree,api-domains-mortgage-certificate,api-domains-signature-collection,api-consultation-portal,clients-adr-and-machine-license,clients-intellectual-properties,clients-judicial-administration,clients-rsk-personal-tax-return,island-ui-vanilla-extract-utils,island-ui-core,portals-admin-document-provider,portals-admin-regulations-admin,portals-my-pages-law-and-order,my-pages-air-discount,portals-my-pages-restrictions,portals-my-pages-documents,portals-my-pages-petitions,portals-admin-form-system,portals-my-pages-licenses,portals-my-pages-sessions,portals-my-pages-consent,portals-my-pages-finance,portals-my-pages-assets,portals-my-pages-health,portals-admin-petition,portals-my-pages-core,financial-aid-shared,island-ui-contentful,portals-admin-core,shared-form-fields,shared-components,react-components,react-spa-bff,react-feature-flags,portals-core,react-spa-shared,shared-connected,api-domains-disability-license,api-domains-health-directorate,clients-vehicle-service-fjs-v1,icelandic-names-registry-types,api-domains-aircraft-registry,api-domains-national-registry,api-domains-company-registry,api-domains-housing-benefits,api-domains-payment-schedule,clients-driving-license-book,clients-hms-housing-benefits,clients-national-registry-v2,clients-national-registry-v3,api-domains-education,clients-mms-grade,clients-identity,clients-rsk-company-registry,clients-signature-collection,content-search-index-manager,content-search-indexer-types,content-search-toolkit,content-search-metrics,judicial-system-court-client,api-domains-criminal-record,api-domains-fishing-license,clients-consultation-portal,judicial-system-audit-trail,air-discount-scheme-consts,clients-althingi-ombudsman,clients-disability-license,clients-health-directorate,clients-judicial-system-sp,clients-smart-solutions-v2,clients-university-careers,judicial-system-formatters,portals-my-pages-constants,air-discount-scheme-types,aircraft-registry,api-domains-api-catalogue,api-domains-ship-registry,api-domains-work-machines,clients-rsk-relationships,clients-work-accident-ver,api-domains-energy-funds,clients-payment-schedule,clients-vehicles-mileage,clients-workpoint-arborg,portals-my-pages-graphql,api-domains-file-upload,api-domains-regulations,api/domains/form-system,clients-criminal-record,clients-driving-license,clients-firearm-license,clients-fishing-license,clients-hunting-license,judicial-system-lawyers,judicial-system-message,api-catalogue-services,api-domains-fiskistofa,clients-ehic-client-v1,clients-smartsolutions,judicial-system-consts,judicial-system-auth,api-catalogue-elastic,api-domains-documents,api-domains-hms-loans,api-domains-syslumenn,clients-work-machines,judicial-system-types,ship-registry,api-catalogue-consts,api-catalogue-types,api-domains-passport,clients-auth-ids-api,clients-documents-v2,clients-energy-funds,api-domains-finance,application-graphql,clients-middlewares,clients-regulations,form-system-client,clients-finance-v2,clients-fiskistofa,clients-hms-loans,clients-mms-frigg,clients-passports,clients-syslumenn,clients-islykill,clients-vehicles,clients-finance,clients-assets,api-domains-assets,clients-p-card,clients-inna,clients-cms,clients-mms,shared-translations,skilavottord-consts,nest-feature-flags,skilavottord-types,testing-containers,message-queue,university-gateway,clients-documents,residence-history,shared-constants,infra-tracing,nest-core,localization,shared-utils,clients-vmst,logging,auth-nest-tools,testing-fixtures,nest-dataloader,nest-audit,clients-zendesk,dokobit-signing,nest-sequelize,email-service,infra-metrics,nest-config,file-storage,nova-sms,nest-aws,cache,island-ui-theme,island-ui-utils,regulations,nest-pagination,user-monitoring,shared-mocking,shared-problem,feature-flags,next-ids-auth,nest-graphql,shared-babel,shared-types,auth-scopes,testing-e2e,api-schema,shared-pii,plausible update dirty files
Stop forceful shutdowns in-cluster.
See https://expressjs.com/en/advanced/healthcheck-graceful-shutdown.html
Nest.js documentation has a section explicitly about this issue:
Summary by CodeRabbit