Skip to content

occasionally getting 2 shadow read callbacks back to back when expected only 1 #806

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

Closed
psddas opened this issue May 14, 2025 · 4 comments
Closed
Labels
closed-for-staleness guidance Question that needs advice or information.

Comments

@psddas
Copy link

psddas commented May 14, 2025

Describe the bug

I am occasionally getting 2 shadow read callbacks back to back when expected only 1.

this is causing a crash in my code based on the internal logic.

--
code:

m_shadowClient->SubscribeToGetNamedShadowAccepted(
    namedShadowSubscriptionRequest,
    AWS_MQTT_QOS_AT_LEAST_ONCE,
    onGetShadowAcceptedNamed,
    onGetShadowUpdatedAcceptedSubAck);

2025-05-12 11:15:46: IOT-SHDW: I: 3481: 10844: read_update :: Classic Shadow : {"state":{"desired":{"...

2025-05-12 11:16:16: IOT-SHDW: I: 3481: 10844: read_update :: Classic Shadow : {"state":{"desired":{"...

Signal 0x6 received from thread 10844
Linux signal, Service: IOT, PID: 3481, TID: 10844, signum: 6

Expected Behavior

Only 1 callback for the read shadow

Current Behavior

sometime I am seeing 2 callbacks for the resd-shadow after connection is done

Reproduction Steps

random

Possible Solution

No response

Additional Information/Context

No response

SDK version used

v1.27.0

Environment details (OS name and version, etc.)

Linux

@psddas psddas added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 14, 2025
@psddas psddas changed the title (short issue description) occasionally getting 2 shadow read callbacks back to back when expected only 1 May 14, 2025
@bretambrose
Copy link
Contributor

bretambrose commented May 14, 2025

There is no guarantee that a QoS1 message will only be delivered once by the broker. Your application must be able to handle duplicates.

@bretambrose bretambrose added guidance Question that needs advice or information. and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 14, 2025
@pranoyd-nd
Copy link

When I used AWS_MQTT_QOS_EXACTLY_ONCE, the connection is interrupted with error "unexpected hungup" and resuming back-to-back.

Will it gurantee one callback? Any known issue with AWS_MQTT_QOS_EXACTLY_ONCE?

@bretambrose
Copy link
Contributor

bretambrose commented May 15, 2025

IoT Core does not support QoS 2.

Consider tracking and using the version field to determine whether or not you should use a response.

@pranoyd-nd
Copy link

@bretambrose , thank you !

@bretambrose bretambrose added the closing-soon This issue will automatically close in 5 days unless further comments are made. label May 21, 2025
@github-actions github-actions bot added closed-for-staleness and removed closing-soon This issue will automatically close in 5 days unless further comments are made. labels May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-for-staleness guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

3 participants