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.
Prior to this change, the inflight batches are referenced
by the last packet ID for non-QoS-0 messages, other packet
IDs sent back from downstream causes an error log:
"Can't be found from the inflight"
Even worse, the batch is appended back to the queue for retry.
We have several reasons to remove this feature:
1. The design does not make sense. A rule engine resource should
not have an impact on the system's messages directly after it is created.
This mqtt_sub actually conflicts with any design concept of the rules engine.
2. The implementation is incorrect. mqtt_sub uses a client pool to establish
a subscription relationship to an MQTT Broker. This causes a message to be
sent repeatedly to EMQ X. Unless a shared subscription is used,
or a Pool Size of 1 is configured.
3. The emqx-bridge-mqtt supports all the features of mqtt_sub.
This feature introduced by https://github.com/emqx/emqx-bridge-mqtt/pull/78.
And it released to v4.2.0 (NOT WORK), v4.2.1-v4.2.7 (FIXED)
For default tsl version and ciphers, we try to use otp release number
to determin if we want to use tlsv1.3
For default configs, we try to porivde both tlsv1.3 and
ciphers in config (even for commented out configs)
For compatibility with versions below 4.2, we still
use the `max_inflight_size` option, but generate it
as the `max_inflight`
Previous PR: https://github.com/emqx/emqx/pull/3938
* chore(conf): add quotation for hocon
* chore(conf): fix paths incompatible with hocon
* chore(conf): use hocon as parsing function
* chore(docker): add quotation to some env variables for hocon
* fix(bridge_mqtt): max_inflight_size -> max_inflight; this enables emqtt.erl to use the value
* chore(bridge_mqtt): fix elvis
* fix(worker): max_inflight_batches -> max_inflight
And move emqx app back to root level
After realising the challenges of developing plugins in standalone
rebar projects. it is perhaps more smooth to keep using emqx as
a rebar dependency
Starting from 5.0.0, all apps in apps dir should follow semver
strictly. Do not use the umbrella project's release tags.
The universal tags made sense when we have applications scattered
in different repos. Now since this is an umbrella project, it is
enough to have a single package level version number corelated with
git tag.