aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2016-03-13 07:26:30 +0100
committerAnders Svensson <[email protected]>2016-03-14 00:48:07 +0100
commitc322099e7e7efeb01577e4c8efd52579beb90949 (patch)
tree18025ccec21dbc7dd661654d3f139ed420f9c4f4 /lib
parent8f9173b675015a1efc34466dace11bfd35a063bd (diff)
downloadotp-c322099e7e7efeb01577e4c8efd52579beb90949.tar.gz
otp-c322099e7e7efeb01577e4c8efd52579beb90949.tar.bz2
otp-c322099e7e7efeb01577e4c8efd52579beb90949.zip
Acknowledge answers to notification pids when throttling
By sending {diameter, {answer, pid()}} when an incoming answer is sent to the specified pid, instead of a discard message as previously. The latter now literally means that the message has been discarded.
Diffstat (limited to 'lib')
-rw-r--r--lib/diameter/src/base/diameter_traffic.erl16
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/diameter/src/base/diameter_traffic.erl b/lib/diameter/src/base/diameter_traffic.erl
index fba4d3736b..724fa855d8 100644
--- a/lib/diameter/src/base/diameter_traffic.erl
+++ b/lib/diameter/src/base/diameter_traffic.erl
@@ -233,12 +233,7 @@ pending(TPids) ->
%% becoming a bottleneck.
receive_message(TPid, {Pkt, NPid}, Dict0, RecvData) ->
- NPid ! {diameter, case incoming(TPid, Pkt, Dict0, RecvData) of
- Pid when is_pid(Pid) ->
- {request, Pid};
- _ ->
- discard
- end};
+ NPid ! {diameter, incoming(TPid, Pkt, Dict0, RecvData)};
receive_message(TPid, Pkt, Dict0, RecvData) ->
incoming(TPid, Pkt, Dict0, RecvData).
@@ -260,16 +255,17 @@ incoming(TPid, Pkt, Dict0, RecvData)
%% Incoming request ...
recv(true, false, TPid, Pkt, Dict0, T) ->
try
- spawn_request(TPid, Pkt, Dict0, T)
+ {request, spawn_request(TPid, Pkt, Dict0, T)}
catch
error: system_limit = E -> %% discard
?LOG(error, E),
- {error, E}
+ discard
end;
%% ... answer to known request ...
recv(false, #request{ref = Ref, handler = Pid} = Req, _, Pkt, Dict0, _) ->
- Pid ! {answer, Ref, Req, Dict0, Pkt};
+ Pid ! {answer, Ref, Req, Dict0, Pkt},
+ {answer, Pid};
%% Note that failover could have happened prior to this message being
%% received and triggering failback. That is, both a failover message
@@ -284,7 +280,7 @@ recv(false, #request{ref = Ref, handler = Pid} = Req, _, Pkt, Dict0, _) ->
recv(false, false, TPid, Pkt, _, _) ->
?LOG(discarded, Pkt#diameter_packet.header),
incr(TPid, {{unknown, 0}, recv, discarded}),
- ok.
+ discard.
%% spawn_request/4