Skip to content

Make shutdown hook configurable #207

@szymonsasin-nordic

Description

@szymonsasin-nordic

Describe the feature

Currently, when the application receives a SIGTERM signal, the CRT library automatically closes all resources via its shutdown hook. This behavior makes it difficult to coordinate a graceful shutdown sequence.

We’d like to make this shutdown hook configurable and expose a method to manually close and release all resources when appropriate.

Use Case

In scenarios where we implement graceful shutdown, we need to:

Stop accepting new requests.

Wait for ongoing requests to complete.

Only then close CRT-related resources.

With the current automatic shutdown behavior, CRT resources are closed before the application finishes handling in-flight requests.

Proposed Solution

Same as it is in aws-crt-java: https://github.com/awslabs/aws-crt-java/blob/main/src/main/java/software/amazon/awssdk/crt/CRT.java#L425

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions