Skip to content

Conversation

simensrostad
Copy link
Contributor

Ensure that state changes are executed in order by queueing an event on callbacks from the internal MQTT thread. This ensures correct order and state changes in the state machine.

@github-actions github-actions bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Aug 28, 2025
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Aug 28, 2025

CI Information

To view the history of this post, clich the 'edited' button above
Build number: 4

Inputs:

Sources:

sdk-nrf: PR head: 0c3bdec99c83c55c744c2b7e0a6540b12d3c2b26

more details

sdk-nrf:

PR head: 0c3bdec99c83c55c744c2b7e0a6540b12d3c2b26
merge base: 09ee10042bf78d173e63dbd08e80cd05fa0af84a
target head (main): a69dbd907d47e9eb660882e303faffa741afa83f
Diff

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (1)
samples
│  ├── net
│  │  ├── mqtt
│  │  │  ├── src
│  │  │  │  ├── modules
│  │  │  │  │  ├── transport
│  │  │  │  │  │  │ transport.c

Outputs:

Toolchain

Version: 53a57c4d75
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:53a57c4d75_bba2ea5f2e

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister
    • sdk-nrf test count: 19
  • ✅ Integration tests
    • ✅ test-fw-nrfconnect-nrf-iot_thingy91
Disabled integration tests
    • test-fw-nrfconnect-nrf_lrcs_mosh
    • test-fw-nrfconnect-nrf_lrcs_positioning
    • desktop52_verification
    • doc-internal
    • test_ble_nrf_config
    • test-fw-nrfconnect-apps
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-ble_samples
    • test-fw-nrfconnect-chip
    • test-fw-nrfconnect-fem
    • test-fw-nrfconnect-nfc
    • test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • test-fw-nrfconnect-nrf-iot_lwm2m
    • test-fw-nrfconnect-nrf-iot_samples
    • test-fw-nrfconnect-nrf-iot_serial_lte_modem
    • test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
    • test-fw-nrfconnect-nrf_crypto
    • test-fw-nrfconnect-proprietary_esb
    • test-fw-nrfconnect-rpc
    • test-fw-nrfconnect-rs
    • test-fw-nrfconnect-tfm
    • test-fw-nrfconnect-thread-main
    • test-low-level
    • test-sdk-audio
    • test-sdk-dfu
    • test-sdk-find-my
    • test-sdk-mcuboot
    • test-sdk-pmic-samples
    • test-sdk-wifi
    • test-secdom-samples-public

Note: This message is automatically posted and updated by the CI

@simensrostad simensrostad marked this pull request as ready for review September 1, 2025 09:45
@simensrostad simensrostad requested review from a team as code owners September 1, 2025 09:46
@simensrostad simensrostad requested a review from Copilot September 1, 2025 09:46
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a Run To Completion pattern for MQTT transport state management by introducing an event queue mechanism. Instead of directly changing states from MQTT callback threads, state changes are now queued as events and processed in the correct thread context.

Key changes:

  • Introduces a private ZBUS channel for internal transport events
  • Replaces direct state transitions in MQTT callbacks with event publishing
  • Adds event processing logic in the main transport task

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@simensrostad simensrostad force-pushed the rtcmqttsample branch 2 times, most recently from 6fd60a3 to 7660f3e Compare September 1, 2025 10:34
Ensure that state changes are executed in order by queueing an event
on callbacks from the internal MQTT thread. This ensures correct order
and state changes in the state machine.

Signed-off-by: Simen S. Røstad <[email protected]>
@simensrostad
Copy link
Contributor Author

@nrfconnect/ncs-modem

@jorgenmk jorgenmk merged commit 96a895a into nrfconnect:main Sep 2, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants