Skip to content

Commit

Permalink
Merge pull request emqx#13086 from qzhuyan/dev/william/quic-lb
Browse files Browse the repository at this point in the history
feat: quic-lb support
  • Loading branch information
qzhuyan authored May 23, 2024
2 parents 147d7f5 + 94e59c8 commit bb3f858
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 5 deletions.
3 changes: 2 additions & 1 deletion apps/emqx/rebar.config.script
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ IsQuicSupp = fun() ->
end,

Bcrypt = {bcrypt, {git, "https://github.com/emqx/erlang-bcrypt.git", {tag, "0.6.0"}}},
Quicer = {quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.313"}}}.
Quicer =
{quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.500"}}}.

Dialyzer = fun(Config) ->
{dialyzer, OldDialyzerConfig} = lists:keyfind(dialyzer, 1, Config),
Expand Down
4 changes: 2 additions & 2 deletions apps/emqx/test/emqx_quic_multistreams_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ t_conn_change_client_addr(Config) ->
NewPort = select_port(),
{ok, OldAddr} = quicer:sockname(Conn),
?assertEqual(
ok, quicer:setopt(Conn, param_conn_local_address, "127.0.0.1:" ++ integer_to_list(NewPort))
ok, quicer:setopt(Conn, local_address, "127.0.0.1:" ++ integer_to_list(NewPort))
),
{ok, NewAddr} = quicer:sockname(Conn),
ct:pal("NewAddr: ~p, Old Addr: ~p", [NewAddr, OldAddr]),
Expand Down Expand Up @@ -1681,7 +1681,7 @@ t_client_conn_bump_streams(Config) ->
]),
{ok, _} = emqtt:quic_connect(C),
{quic, Conn, _Stream} = proplists:get_value(socket, emqtt:info(C)),
ok = quicer:setopt(Conn, param_conn_settings, #{peer_unidi_stream_count => 20}).
ok = quicer:setopt(Conn, settings, #{peer_unidi_stream_count => 20}).

t_olp_true(Config) ->
meck:new(emqx_olp, [passthrough, no_history]),
Expand Down
10 changes: 10 additions & 0 deletions apps/emqx_conf/src/emqx_conf_schema.erl
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,16 @@ fields("cluster") ->
desc => ?DESC(cluster_proto_dist)
}
)},
{"quic_lb_mode",
sc(
integer(),
#{
mapping => "quicer.lb_mode",
default => 0,
'readOnly' => true,
desc => ?DESC(cluster_quic_lb_mode)
}
)},
{"static",
sc(
?R_REF(cluster_static),
Expand Down
4 changes: 3 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,9 @@ defmodule EMQXUmbrella.MixProject do
defp quicer_dep() do
if enable_quicer?(),
# in conflict with emqx and emqtt
do: [{:quicer, github: "emqx/quic", tag: "0.0.313", override: true}],
do: [
{:quicer, github: "emqx/quic", tag: "0.0.500", override: true}
],
else: []
end

Expand Down
2 changes: 1 addition & 1 deletion rebar.config.erl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ assert_otp() ->
end.

quicer() ->
{quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.313"}}}.
{quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.500"}}}.

jq() ->
{jq, {git, "https://github.com/emqx/jq", {tag, "v0.3.12"}}}.
Expand Down
9 changes: 9 additions & 0 deletions rel/i18n/emqx_conf_schema.hocon
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ cluster_proto_dist.desc:
cluster_proto_dist.label:
"""Cluster Protocol Distribution"""

cluster_quic_lb_mode.desc:
"""QUIC stack LB Mode
- 0: disabled (Default)
- 1: server_ip
- 2: server_id_fixed"""

cluster_quic_lb_mode.label:
""" QUIC stack LB Mode """

log_burst_limit_enable.desc:
"""Enable log burst control feature."""

Expand Down

0 comments on commit bb3f858

Please sign in to comment.