aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter
AgeCommit message (Collapse)Author
2016-03-18Let throttling callback send a throttle messageAnders Svensson
That is, don't assume that it's only diameter_tcp doing so: allow it to be received when not throttling. This lets a callback module trigger a new throttling callback itself, but it's not clear if this will be useful in practice.
2016-03-16Make peer failover more efficientAnders Svensson
Failover caused the entire request table to be scanned in search of entries with the transport process in question. With many entries (possibly as a result of the leak fixed in commit 6c9cbd96), this can lead to the service process hanging in ets:select_trap/1, with memory growth when many request processes write concurrently. Now write entries keyed on the transport pid, so that finding request processes at failover is a lookup rather than a select scanning the entire table. There is no upgrade handling in that new code doesn't consider that old code didn't write entries on the transport pid. Thus, a request whose table entries were written in old code will timeout rather than failover in new code. That is, there is a small window for failover to be missed (since request processes are short-lived), but it requires that it take place during the upgrade. As a minor aside, don't ignore failovers when sending binaries (which isn't officially supported), let prepare_retransmit callbacks deal with modifying the binary as required.
2016-03-15update copyright-yearHenrik Nord
2016-03-15Merge tag 'OTP-18.3'Lars Thorsen
=== OTP-18.3 === Changed Applications: - asn1-4.0.2 - common_test-1.12 - compiler-6.0.3 - cosNotification-1.2.1 - cosTime-1.2.1 - cosTransactions-1.3.1 - crypto-3.6.3 - debugger-4.1.2 - dialyzer-2.9 - diameter-1.11.2 - edoc-0.7.18 - eldap-1.2.1 - erl_docgen-0.4.2 - erl_interface-3.8.2 - erts-7.3 - eunit-2.2.13 - hipe-3.15 - inets-6.2 - kernel-4.2 - mnesia-4.13.3 - observer-2.1.2 - orber-3.8.1 - public_key-1.1.1 - runtime_tools-1.9.3 - sasl-2.7 - snmp-5.2.2 - ssh-4.2.2 - ssl-7.3 - stdlib-2.8 - test_server-3.10 - tools-2.8.3 - webtool-0.9.1 - wx-1.6.1 - xmerl-1.3.10 Unchanged Applications: - cosEvent-2.2 - cosEventDomain-1.2 - cosFileTransfer-1.2 - cosProperty-1.2 - et-1.5.1 - gs-1.6 - ic-4.4 - jinterface-1.6.1 - megaco-3.18 - odbc-2.11.1 - os_mon-2.4 - ose-1.1 - otp_mibs-1.1 - parsetools-2.1.1 - percept-0.8.11 - reltool-0.7 - syntax_tools-1.7 - typer-0.9.10 Conflicts: OTP_VERSION erts/vsn.mk lib/test_server/doc/src/notes.xml lib/test_server/vsn.mk lib/webtool/doc/src/notes.xml lib/webtool/vsn.mk
2016-03-14Prepare releaseErlang/OTP
2016-03-14Acknowledge answers to notification pids when throttlingAnders Svensson
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.
2016-03-13Throttle properly with TLSAnders Svensson
In particular, let a callback decide when to receive the initial message.
2016-03-13Don't ask throttling callback to receive more unless neededAnders Svensson
TCP packets can contain more than one message, so only ask to receive another message if it hasn't already been received.
2016-03-13Let a throttling callback answer a received messageAnders Svensson
As discussed in the parent commit. This is easier said than done in practice, but there's no harm in allowing it.
2016-03-13Let a throttling callback discard a received messageAnders Svensson
This can be used as a simple form of overload protection, discarding the message before it's passed into diameter to become one more request process in a flood. Replying with 3004 would be more appropriate when the request has been directed at a specific server (the RFC's requirement) however, and possibly it should be possible for a callback to do this as well.
2016-03-13Let throttling callback return a notification pidAnders Svensson
In addition to returning ok or {timeout, Tmo}, let a throttling callback for message reception return a pid(), which is then notified if the message in question is either discarded or results in a request process. Notification is by way of messages of the form {diameter, discard | {request, pid()}} where the pid is that of a request process resulting from the received message. This allows the notification process to keep track of the maximum number of request processes a peer connection can have given rise to.
2016-03-13Make throttling callbacks on message receptionAnders Svensson
The callback is now applied to the atom 'false' when asking if another message should be received on the socket, and to a received binary message after reception. Throttling on received messages makes it possible to distinguish between requests and answers. There is no callback on outgoing messages since these don't have to go through the transport process, even if they currently do.
2016-03-13Add diameter_tcp option throttle_cbAnders Svensson
To let a callback module decide whether or to receive another message from the peer, so that backpressure can be applied when it's inappropriate. This is to let a callback protect against reading more than can be processed, which is otherwise possible since diameter_tcp otherwise always asks for more. A callback is made after each message, and can answer to continue reading or to ask again after a timeout. It's each message instead of each packet partly for simplicity, but also since this should be sufficiently fine-grained. Per packet would require some interaction with the fragment timer that flushes partial messages that haven't been completely received.
2016-03-10Prepare releaseErlang/OTP
2016-03-10Merge branch 'anders/diameter/dialyzer/OTP-13400' into maint-17Erlang/OTP
* anders/diameter/dialyzer/OTP-13400: Fix dialyzer warnings
2016-03-10Merge branch 'anders/diameter/17.5.6.9/OTP-13385' into maint-17Erlang/OTP
* anders/diameter/17.5.6.9/OTP-13385: vsn -> 1.9.2.4 Update appup for 17.5.6.9
2016-03-09Merge branch 'maint'Anders Svensson
2016-03-09Merge branch 'anders/diameter/18/dialyzer/OTP-13400' into maintAnders Svensson
* anders/diameter/18/dialyzer/OTP-13400: Fix dialyzer warnings
2016-03-08Merge branch 'maint'Anders Svensson
2016-03-08Merge branch 'anders/diameter/18.3/OTP-13322' into maintAnders Svensson
* anders/diameter/18.3/OTP-13322: vsn -> 1.11.2 Update appup for 18.3
2016-03-07Fix dialyzer warningsAnders Svensson
Whether making record declarations unreadable to compensate for dialyzer's ignorance of match specs is worth it is truly debatable.
2016-03-07Fix dialyzer warningsAnders Svensson
Whether making record declarations unreadable to compensate for dialyzer's ignorance of match specs is worth it is truly debatable.
2016-03-07Merge branch 'maint'Anders Svensson
2016-03-07Merge branch 'anders/diameter/retransmission/OTP-13342' into maintAnders Svensson
* anders/diameter/retransmission/OTP-13342: Fix handling of shared peer connections in watchdog state SUSPECT Remove unnecessary parentheses Remove dead export
2016-02-29vsn -> 1.11.2Anders Svensson
2016-02-29Update appup for 18.3Anders Svensson
OTP-13164 more efficient peer lookup OTP-13342 remote watchdog transition into state SUSPECT
2016-02-29vsn -> 1.9.2.4Anders Svensson
2016-02-29Update appup for 17.5.6.9Anders Svensson
OTP-13342 remote watchdog transition to state SUSPECT
2016-02-19Fix handling of shared peer connections in watchdog state SUSPECTAnders Svensson
A peer connection shared from a remote node was regarded as being available for peer selection (aka up) as long as its peer_fsm process was alive; that is, for the lifetime of the peer connection. In particular, it didn't take note of transitions into watchdog state SUSPECT, when the connection remains. As a result, retransmissions could select the same peer connection whose watchdog transition caused the retransmission. A service process now broadcasts a peer_down event just as it does a peer_up event. The fault predates the table rearrangements of commit 8fd4e5f4.
2016-02-19Remove unnecessary parenthesesAnders Svensson
Not needed as of commit 6c9cbd96.
2016-02-19Remove dead exportAnders Svensson
The export of diameter_traffic:failover/1 happened with the creation of the module in commit e49e7acc, but was never needed since the calling code was also moved into diameter_traffic.
2016-02-09Make peer handling more efficientAnders Svensson
Each service process maintains a dictionary of peers, mapping an application alias to a {pid(), #diameter_caps{}} list of connected peers. These lists are potentially large, peers were appended to the end of the list for no particular reason, and these long lists were constructed/deconstructed when filtering them for pick_peer callbacks. Many simultaneous outgoing request could then slow the VM to a crawl, with many scheduled processes mired in list manipulation. The pseudo-dicts are now replaced by plain ets tables. The reason for them was (once upon a time) to have an interface interchangeable with a plain dict for debugging purposes, but strict swapablity hasn't been the case for some time now, and in practice a swap has never taken place. Additional tables mapping Origin-Host/Realm have also been introduced, to minimize the size of the peers lists when peers are filtered on host/realm. For example, a filter like {any, [{all, [realm, host]}, realm]} is probably a very common case: preferring a Destination-Realm/Host match before falling back on Destination-Realm alone. This is now more efficiently (but not equivalently) expressed as {first, [{all, [realm, host]}, realm]} to stop the search when the best match is made, and extracts peers from host/realm tables instead of searching through the list of all peers supporting the application in question. The code to try and start with a lookup isn't exhaustive, and the 'any' filter is still as inefficient as previously.
2016-02-09Remove unnecessary erlang:monitor/2 qualificationAnders Svensson
See commit 862af31d.
2016-02-08Merge branch 'maint'Anders Svensson
2016-01-29Add missing appup after 17.5.6.8 mergeAnders Svensson
In commit b8c6a119.
2016-01-27Merge branch 'maint'Anders Svensson
2016-01-27Merge branch 'maint-17' into maintAnders Svensson
2016-01-26Update release notesErlang/OTP
2016-01-26Merge branch 'anders/diameter/17.5.6.8/OTP-13212' into maint-17Erlang/OTP
* anders/diameter/17.5.6.8/OTP-13212: vsn -> 1.9.2.3 Update appup for 17.5.6.8
2015-12-22Merge branch 'maint'Anders Svensson
2015-12-22Merge branch 'maint-17' into maintAnders Svensson
2015-12-21Make peer handling more efficientAnders Svensson
Each service process maintains a dictionary of peers, mapping an application alias to a {pid(), #diameter_caps{}} list of connected peers. These lists are potentially large, peers were appended to the end of the list for no particular reason, and these long lists were constructed/deconstructed when filtering them for pick_peer callbacks. Many simultaneous outgoing request could then slow the VM to a crawl, with many scheduled processes mired in list manipulation. The pseudo-dicts are now replaced by plain ets tables. The reason for them was (once upon a time) to have an interface interchangeable with a plain dict for debugging purposes, but strict swapablity hasn't been the case for some time now, and in practice a swap has never taken place. Additional tables mapping Origin-Host/Realm have also been introduced, to minimize the size of the peers lists when peers are filtered on host/realm. For example, a filter like {any, [{all, [realm, host]}, realm]} is probably a very common case: preferring a Destination-Realm/Host match before falling back on Destination-Realm alone. This is now more efficiently (but not equivalently) expressed as {first, [{all, [realm, host]}, realm]} to stop the search when the best match is made, and extracts peers from host/realm tables instead of searching through the list of all peers supporting the application in question. The code to try and start with a lookup isn't exhaustive, and the 'any' filter is still as inefficient as previously.
2015-12-21Remove unnecessary erlang:monitor/2 qualificationAnders Svensson
See commit 862af31d.
2015-12-21vsn -> 1.9.2.3Anders Svensson
2015-12-21Update appup for 17.5.6.8Anders Svensson
OTP-13164 more efficient peer lists One module. Downgrade not supported.
2015-12-20Update release notesErlang/OTP
2015-12-20Merge branch 'anders/diameter/17.5.6.7/OTP-13211' into maint-17Erlang/OTP
* anders/diameter/17.5.6.7/OTP-13211: vsn -> 1.9.2.2 Update/fix appup for 17.5.6.7 Be resilient to diameter_service state upgrades
2015-12-20Merge branch 'anders/diameter/request_leak/OTP-13137' into maint-17Erlang/OTP
* anders/diameter/request_leak/OTP-13137: Fix request table leak at retransmission Fix request table leak at exit signal
2015-12-20vsn -> 1.9.2.2Anders Svensson
2015-12-20Update/fix appup for 17.5.6.7Anders Svensson
OTP-12947 strict_mbit OTP-12969 watchdog function_clause OTP-13137 request leak diameter_config (that allows the new option) should be loaded after the others. Anchor was missing from one regexp. Patches did not accumulate through older versions.