Comments (10)
@didier-wenzek I've added logs to the repository for the individual components, and included the .agent/workflow
file after the test was stopped
Though the nanomq.log
has a lot of error messages, so maybe something is not correct in the nanomq build, as it does not seem to respect the QoS (for unknown reasons).
from thin-edge.io.
Here is a first difference between mosquitto vs nanomq that explains message duplicates:
If a client subscribes to overlapping topic filters (say test/+/xxx
and test/xxx/+
),
then a message published on the intersection (say on test/xxx/xxx
):
- is delivered once to the subscriber by mosquitto
- but is delivered as many as matching subscriptions by nanomq
And indeed the c8y mapper is subscribing to overlapping topic filters:
te/+/+/+/+/cmd/software_list/+
te/+/+/+/+/cmd/software_list
te/device/main///cmd/software_list/+
from thin-edge.io.
Having a look to the log
- This log is a mix of agent and mapper output.
That's okay, but it would help to also have the MQTT messages exchange between the two processes.
I.e. to gather the output of:$ tedge mqtt sub 'te/#' & $ tedge_mapper_c8y & $ tedge_agent &
- The mapper issued a single software list request
c8y-mapper-2024-06-19T18
- But the agent processed this request 29 times!
- A weird but a systematic pattern. The request is
- scheduled once
- rejected 9 times (because being duplicated)
- reported as successful (awaiting to be cleared by the mapper)
- The agent starts by reporting 29 successful requests waiting to be cleared.
- These requests are resumed on restart
- Did the mapper failed to acknowledge those during the previous run?
- Is this number of 29 increasing after each run?
- It would be good to see the persisted operations in
/etc/tedge/.agent/workflows
(in this specific setting:/data/etc/tedge/.agent/workflows
).
- There are weird
rumqttc
errors:INFO rumqttc::state: Collision on packet id = 7
- It would be good to know if on the agent, the mapper or the bridge
- Harmless:
WARN tedge_config::sudo:
sudo.enableset to
true, but sudo not found in $PATH
from thin-edge.io.
The agent is persisting (in .agent/workflows
) plenty of successful software list requests.
- The agent never received clearing messages for those.
- All these requests have been generated by the mapper in less then a 1 second!
The MQTT log confirms that:
- all the software list requests generated by the mapper are properly executed but never cleared:
there is no empty retain message published on thete/device/main///cmd/software_list/+
topics. - All the retain messages are duplicated ad nauseam:
the mapper reacts to each software update capability by generating a software list request.
from thin-edge.io.
If a client subscribes to overlapping topic filters (say
test/+/xxx
andtest/xxx/+
),
then a message published on the intersection (say ontest/xxx/xxx
):
- is delivered once to the subscriber by mosquitto
- but is delivered as many as matching subscriptions by nanomq
According to the MQTT specs, both behavior are accepted:
it is possible for a Client’s subscriptions to overlap so that a published message might match multiple filters. In this case the Server MUST deliver the message to the Client respecting the maximum QoS of all the matching subscriptions [MQTT-3.3.5-1]. In addition, the Server MAY deliver further copies of the message, one for each additional matching subscription and respecting the subscription’s QoS in each case.
from thin-edge.io.
The latest version of NanoMQ has an incorrect behavior when a client has several subscriptions.
It incorrectly delivers a copy of the message for each subscription even if unrelated :
$ docker run -d --name nanomq -p 1883:1883 -p 8083:8083 -p 8883:8883 emqx/nanomq:latest
$ mosquitto_pub -r -t sport -m tennis
$ mosquitto_sub -t sport
tennis
^C
$ mosquitto_sub -t unrelated
^C
$ mosquitto_sub -t sport -t unrelated
tennis
tennis
^C
from thin-edge.io.
A ticket has been created in the nanomq, nanomq/nanomq#1817, where it seems there was a recent change that introduced this erroneous behaviour for retained messages
from thin-edge.io.
Sorry to break this. 0.22.0 is a beta release, hopefully I didn't make too much trouble for you
from thin-edge.io.
Sorry to break this. 0.22.0 is a beta release, hopefully we I didn't make too much trouble for you
All good. We actually stumbled across it as we were building a static binary from the main branch…it took us a while to find out the reason for the unexpected behaviour, but glad we’re able to help identify the issue in the end.
from thin-edge.io.
QA tested the bug and it is not reproducable, creating test case to cover this bug is in progress
from thin-edge.io.
Related Issues (20)
- Support multiple cloud connections of the same type in container environments HOT 1
- flaky test: Registration Lifecycle.Entities persisted and restored
- allow users to add workflow states after a built-in executing action HOT 2
- Unchecked unwrap resulting in a panic in JWT handling
- flaky unittest: bridge_reconnects_successfully_after_local_connection_interrupted HOT 1
- flaky system test: tedge_connect_test_sm_services HOT 1
- tedge connect c8y does not cleanly close the local MQTT connection HOT 2
- flaky unittest: file_transfer_server::http_rest::tests::uploaded_file_can_be_downloaded_from_the_api
- tedge-agent does not respect custom root prefix when provided via the cli flag HOT 2
- tedge-agent still subscribes to legacy topics when running as a child device HOT 1
- Support Cumulocity IoT basic device registration to allow SmartREST 1.0 usage for older clients HOT 1
- MQTT connection using websocket HOT 1
- flaky unittest: tests::test_cli_pub_basic::some_2_expects HOT 1
- tedge-mapper-c8y is sending cloud operation status for sub workflow calls HOT 1
- tedge-mapper-c8y: registered child-device does not receive data anymore after restart HOT 2
- Robot test MQTT clients disconnecting due to out of memory HOT 2
- Set the name of the 'main' Device HOT 1
- Built in mqtt bridge restricted to 10240 bytes HOT 2
- Software update logs don't give any error information if the software type doesn't have a corresponding plugin HOT 3
- Software updates are downloaded multiple times when update-list isn't supported by the relevant plugin HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thin-edge.io.