Преглед изворни кода

test: debug broker segmentation fault

Zhongwen Deng пре 3 година
родитељ
комит
2b4b3d1b56

+ 21 - 20
apps/emqx/etc/emqx.conf

@@ -1,39 +1,40 @@
 
 listeners.tcp.default {
-  bind = "0.0.0.0:1883"
-  max_connections = 1024000
+  bind: "0.0.0.0:1883"
+  max_connections: 1024000
 }
 
 listeners.ssl.default {
-  bind = "0.0.0.0:8883"
-  max_connections = 512000
+  bind: "0.0.0.0:8883"
+  max_connections: 512000
   ssl {
-    keyfile = "{{ platform_etc_dir }}/certs/key.pem"
-    certfile = "{{ platform_etc_dir }}/certs/cert.pem"
-    cacertfile = "{{ platform_etc_dir }}/certs/cacert.pem"
+    keyfile: "{{ platform_etc_dir }}/certs/key.pem"
+    certfile: "{{ platform_etc_dir }}/certs/cert.pem"
+    cacertfile: "{{ platform_etc_dir }}/certs/cacert.pem"
   }
 }
 
 listeners.ws.default {
-  bind = "0.0.0.0:8083"
-  max_connections = 1024000
+  bind: "0.0.0.0:8083"
+  max_connections: 1024000
   websocket.mqtt_path: "/mqtt"
 }
 
 listeners.wss.default {
-  bind = "0.0.0.0:8084"
-  max_connections = 512000
+  bind: "0.0.0.0:8084"
+  max_connections: 512000
   websocket.mqtt_path: "/mqtt"
   ssl {
-    keyfile = "{{ platform_etc_dir }}/certs/key.pem"
-    certfile = "{{ platform_etc_dir }}/certs/cert.pem"
-    cacertfile = "{{ platform_etc_dir }}/certs/cacert.pem"
+    keyfile: "{{ platform_etc_dir }}/certs/key.pem"
+    certfile: "{{ platform_etc_dir }}/certs/cert.pem"
+    cacertfile: "{{ platform_etc_dir }}/certs/cacert.pem"
   }
 }
 
-//listeners.quic.default {
-//    bind = "0.0.0.0:14567"
-//    max_connections = 1024000
-//    keyfile = "{{ platform_etc_dir }}/certs/key.pem"
-//    certfile = "{{ platform_etc_dir }}/certs/cert.pem"
-//  }
+listeners.quic.default {
+  enabled: true
+  bind: "0.0.0.0:14567"
+  max_connections: 1024000
+  keyfile: "{{ platform_etc_dir }}/certs/key.pem"
+  certfile: "{{ platform_etc_dir }}/certs/cert.pem"
+}

+ 12 - 3
apps/emqx/src/emqx_config.erl

@@ -17,6 +17,7 @@
 
 -compile({no_auto_import, [get/0, get/1, put/2, erase/1]}).
 -elvis([{elvis_style, god_modules, disable}]).
+-include("logger.hrl").
 
 -export([
     init_load/1,
@@ -347,9 +348,17 @@ raw_conf_with_default(SchemaMod, RootNames, RawConf) ->
 
 schema_default(Schema) ->
     case hocon_schema:field_schema(Schema, type) of
-        ?ARRAY(_) -> [];
-        ?LAZY(?ARRAY(_)) -> [];
-        _ -> #{}
+        ?ARRAY(_) ->
+            [];
+        ?LAZY(?ARRAY(_)) ->
+            [];
+        ?LAZY(?UNION(Unions)) ->
+            case [A || ?ARRAY(A) <- Unions] of
+                [_ | _] -> [];
+                _ -> #{}
+            end;
+        _ ->
+            #{}
     end.
 
 parse_hocon(Conf) ->

+ 0 - 5
apps/emqx/src/emqx_limiter/etc/emqx_limiter.conf

@@ -1,5 +0,0 @@
-##--------------------------------------------------------------------
-## EMQX Rate Limiter
-##--------------------------------------------------------------------
-
-limiter {}

+ 4 - 0
apps/emqx/test/emqx_broker_SUITE.erl

@@ -435,6 +435,10 @@ t_connected_client_count_persistent(Config) when is_list(Config) ->
         {clientid, ClientID}
         | Config
     ]),
+    {{ok, _}, {ok, [_]}} = wait_for_events(
+        fun() -> emqtt:ConnFun(ConnPid2) end,
+        [emqx_cm_connected_client_count_inc]
+    ),
     {{ok, _}, {ok, [_, _]}} = wait_for_events(
         fun() -> emqtt:ConnFun(ConnPid2) end,
         [