Commit Graph

79 Commits

Author SHA1 Message Date
Thales Macedo Garitezi 46393343e2 chore: use `timeout_duration` types for timer fields
Fixes https://emqx.atlassian.net/browse/EMQX-10020
2023-06-05 11:46:38 -03:00
Zaiming (Stone) Shi aa46c0a484
Merge pull request #10928 from zmstone/0602-sync-release-51-to-master
0602 sync release 51 to master
2023-06-02 21:45:21 +02:00
Thales Macedo Garitezi 99796224d8 refactor(resource): rename `request_timeout` -> `request_ttl`
See
https://emqx.atlassian.net/wiki/spaces/P/pages/612368639/open+e5.1+remove+auto+restart+interval+from+buffer+worker+resource+options
2023-06-01 13:01:53 -03:00
Thales Macedo Garitezi 10425eb925 feat(resource): deprecate `auto_restart_interval` in favor of `health_check_interval`
See:
https://emqx.atlassian.net/wiki/spaces/P/pages/612368639/open+e5.1+remove+auto+restart+interval+from+buffer+worker+resource+options

Current problem:

In 5.0.x, we have two timer options that control the state changing of buffer worker
resources: auto_restart_interval and health_check_interval.

- auto_restart_interval controls how often the resource attempts to transition from
disconnected to connected.

- health_check_interval controls how often the resource is checked and potentially moved
from connected to disconnected or connecting.

The existence of two independent timers for very similar purposes is confusing to users,
QA and even developers.  Also, an intimately related configuration is request_timeout,
which can interact badly with auto_restart_interval if the latter is poorly configured:
requests may always expire if request_timeout < auto_restart_interval and if the resource
enters the disconnected state.  For health_check_interval, we attempt to derive a sane
default that gives requests a chance to retry (if request timeout is finite, then the
resource retries requests with a period of min(health_check_interval, request_timeout /
3).

Another problem with the separate auto_restart_interval is that its default value (60 s)
is too high when compared to the default request timeout and health check, leading to the
problems described above if not tuned.

Proposed solution:

We propose to drop auto_restart_interval in favor of health_check_interval, which will be
used for both disconnected -> connected and connected -> {disconnected, connecting}
transition checks.  With that, the resource will attempt to reconnect at the same interval
as the health check, which currently is 15 s.

Also, as two smaller changes to accompany this one:

- Increase the default request_timeout from 15 s to 45 s.
- Rename request_timeout to request_ttl.
2023-06-01 11:20:06 -03:00
Stefan Strigler e011b5532f
Merge pull request #10881 from sstrigler/EMQX-9355-5-0-x-test-coverage-80
IoTDB test coverage
2023-06-01 15:48:56 +02:00
firest cb31032e6d chore: make dialyzer && test happy 2023-06-01 11:15:51 +08:00
Stefan Strigler 1e4cee05df fix(emqx_bridge_iotdb): handle rule engine passed payload
also remove topic logic as it's duplicated functionality via rule engine
2023-05-31 15:57:22 +02:00
Stefan Strigler 6c0fb0e2ea test: run tests against iotdb013 container 2023-05-31 11:30:13 +02:00
Stefan Strigler 767f7c57e7 test: check device_id is used from topic or config 2023-05-30 15:55:21 +02:00
Stefan Strigler 938d62a666 test: handle bad payload 2023-05-30 15:55:21 +02:00
Stefan Strigler 860d7b169a test: check data at iotdb instance 2023-05-30 15:55:21 +02:00
Stefan Strigler a3021c58f1 fix(emqx_bridge_iotdb): allow integer timestamp 2023-05-30 15:55:21 +02:00
Stefan Strigler bd92116cee test: fix data in calls to look like real world 2023-05-30 15:55:21 +02:00
Stefan Strigler 1381b54a8d fix(emqx_bridge_iotdb): allow non-binary values 2023-05-30 15:55:21 +02:00
Stefan Strigler 64d582770d test: add tracepoints 2023-05-30 15:55:21 +02:00
Stefan Strigler 3d3f2a223c test: test more value conversions 2023-05-30 15:55:21 +02:00
Stefan Strigler 6f54220a51 feat(emqx_bridge_iotdb): handle bad message format gracefully 2023-05-30 15:55:20 +02:00
Zaiming (Stone) Shi cc5b4d3748 Merge remote-tracking branch 'origin/release-50' into 0526-ci-delete-otp-24-from-standalone-app-test 2023-05-26 15:58:16 +02:00
JianBo He fdec86e29c
Merge pull request #10802 from Kinplemelon/kinple/set-base-url-required
fix: set the base_url in IoTDB bridge as a required field
2023-05-25 18:12:05 +08:00
JimMoen 28015597ee
Merge remote-tracking branch 'emqx/release-50' into merge-release-50 2023-05-24 19:34:12 +08:00
Kjell Winblad 4f21bdb885 fix: REST API version 2 not available in IoTDB 0.13 and 1.0
This commit makes sure that REST API version 1 is used when the
user has selected to use IoTDB 0.13 or 1.0

Fixes:
https://emqx.atlassian.net/browse/EMQX-9920
2023-05-24 13:09:47 +02:00
Kinplemelon 7cad1cb93a fix: set the base_url in IoTDB bridge
as a required field
2023-05-24 18:18:32 +08:00
Kjell Winblad 63180c87be
style: simplify code for better readability
Co-authored-by: Thales Macedo Garitezi <thalesmg@gmail.com>
2023-05-23 18:53:14 +02:00
Kjell Winblad 89ea1646be fix: IoTDB name for version option
The previous name for the version option was v1.0.x which is clearly
wrong since this option was tested against IoTDB version v1.1.0. This
commit fixes this by renaming the option to v1.x.

Fixes:
https://emqx.atlassian.net/browse/EMQX-9926
2023-05-23 10:57:05 +02:00
Kjell Winblad d19ddb1832 fix: IoTDB bridge incoming payload needs to be parsed as JSON
There was an incorrect assumption that the data incoming to the IoTDB
bridge has already been parsed. This is fixed by parsing the payload as
JSON data if the payload is not already a map.

Fixes:
https://emqx.atlassian.net/browse/EMQX-9854
2023-05-23 10:14:45 +02:00
JianBo He 38fcb7a097 docs: hide the not-ready document links 2023-05-15 11:20:23 +08:00
JianBo He 383fec9dfc docs: fix invalid links 2023-05-15 11:18:09 +08:00
Kjell Winblad 08af90daa9 fix: the iotdb password field so it has the password format 2023-05-10 10:38:40 +02:00
Stefan Strigler d231e708cb feat: add IotDB bridge 2023-05-08 16:19:01 +02:00