Skip to content

MQTT MessageHandler never called after a SIGTERM event #827

Answered by bretambrose
RaphaelPineau asked this question in Q&A
Discussion options

You must be logged in to vote

Once the CRT's shutdown hook is executed by the JVM (presumably in response to the signal), no further callbacks are made from native to Java as it is no longer safe to do so.

You can delay CRT shutdown via the APIs here:
https://github.com/awslabs/aws-crt-java/blob/main/src/main/java/software/amazon/awssdk/crt/CRT.java#L449-L494

But if you delay it past all shutdown hooks resolving it will likely crash when the JNI boundary becomes unsafe to call.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@RaphaelPineau
Comment options

Answer selected by RaphaelPineau
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants