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

test: channel process func rename

JimMoen пре 1 година
родитељ
комит
14b48c94e2

+ 13 - 3
apps/emqx/src/emqx_channel.erl

@@ -908,7 +908,12 @@ process_subscribe(SubPkt = ?SUBSCRIBE_PACKET(PacketId, _Properties, _TopicFilter
             handle_out(disconnect, RC, Channel)
     end.
 
--compile({inline, [post_process_subscribe/2]}).
+-compile(
+    {inline, [
+        post_process_subscribe/2,
+        post_process_subscribe/3
+    ]}
+).
 post_process_subscribe(TopicFilters, Channel) ->
     post_process_subscribe(TopicFilters, Channel, []).
 
@@ -991,7 +996,12 @@ process_unsubscribe(
             handle_out(disconnect, ReasonCode, Channel)
     end.
 
--compile({inline, [post_process_unsubscribe/3]}).
+-compile(
+    {inline, [
+        post_process_unsubscribe/3,
+        post_process_unsubscribe/4
+    ]}
+).
 post_process_unsubscribe(TopicFilters, UnSubProps, Channel) ->
     post_process_unsubscribe(TopicFilters, UnSubProps, Channel, []).
 
@@ -1489,7 +1499,7 @@ handle_call(Req, Channel) ->
 
 handle_info({subscribe, TopicFilters}, Channel) ->
     NTopicFilters = enrich_subscribe(TopicFilters, Channel),
-    {_TopicFiltersWithRC, NChannel} = process_subscribe(NTopicFilters, Channel),
+    {_TopicFiltersWithRC, NChannel} = post_process_subscribe(NTopicFilters, Channel),
     {ok, NChannel};
 handle_info({unsubscribe, TopicFilters}, Channel) ->
     {_RC, NChannel} = post_process_unsubscribe(TopicFilters, #{}, Channel),

+ 2 - 2
apps/emqx/test/emqx_channel_SUITE.erl

@@ -475,12 +475,12 @@ t_process_subscribe(_) ->
     ok = meck:expect(emqx_session, subscribe, fun(_, _, _, Session) -> {ok, Session} end),
     TopicFilters = [TopicFilter = {<<"+">>, ?DEFAULT_SUBOPTS}],
     {[{TopicFilter, ?RC_SUCCESS}], _Channel} =
-        emqx_channel:process_subscribe(TopicFilters, channel()).
+        emqx_channel:post_process_subscribe(TopicFilters, channel()).
 
 t_process_unsubscribe(_) ->
     ok = meck:expect(emqx_session, unsubscribe, fun(_, _, _, Session) -> {ok, Session} end),
     TopicFilters = [{<<"+">>, ?DEFAULT_SUBOPTS}],
-    {[?RC_SUCCESS], _Channel} = emqx_channel:process_unsubscribe(TopicFilters, #{}, channel()).
+    {[?RC_SUCCESS], _Channel} = emqx_channel:post_process_unsubscribe(TopicFilters, #{}, channel()).
 
 t_quota_qos0(_) ->
     esockd_limiter:start_link(),

+ 2 - 1
apps/emqx_opentelemetry/src/sampler/emqx_otel_sampler.erl

@@ -235,7 +235,7 @@ should_sample(
         otel_span:tracestate(otel_tracer:current_span_ctx(Ctx))
     }.
 
-%% -compile({inline, [match_sample/2]}).
+-compile({inline, [match_by_span_name/2]}).
 match_by_span_name(?BROKER_PUBACK_SPAN_NAME, L) -> ?QOS_1 =< L;
 match_by_span_name(?CLIENT_PUBACK_SPAN_NAME, L) -> ?QOS_1 =< L;
 match_by_span_name(?BROKER_PUBREC_SPAN_NAME, L) -> ?QOS_1 =< L;
@@ -317,6 +317,7 @@ match_topic_filter(TopicName, #?EMQX_OTEL_SAMPLER_RULE{
 }) ->
     emqx_topic:match(TopicName, TopicFilter) andalso ShouldSample.
 
+-compile({inline, [parent_sampled/1]}).
 parent_sampled(#span_ctx{trace_flags = TraceFlags}) when
     ?IS_SAMPLED(TraceFlags)
 ->