aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src
AgeCommit message (Collapse)Author
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-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-29Update appup for 18.3Anders Svensson
OTP-13164 more efficient peer lookup OTP-13342 remote watchdog transition into 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-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-21Update appup for 17.5.6.8Anders Svensson
OTP-13164 more efficient peer lists One module. Downgrade not supported.
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-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.
2015-12-20Be resilient to diameter_service state upgradesAnders Svensson
By not failing in code that looks up state: pick_peer and service_info.
2015-12-09Merge branch 'maint'Anders Svensson
2015-12-09Merge branch 'anders/diameter/18.2/OTP-13180' into maintAnders Svensson
* anders/diameter/18.2/OTP-13180: vsn -> 1.11.1 Update appup for 18.2
2015-12-09Merge branch 'anders/diameter/request_leak/OTP-13137' into maintAnders Svensson
* anders/diameter/request_leak/OTP-13137: Fix request table leak at retransmission Fix request table leak at exit signal
2015-12-09Fix request table leak at retransmissionAnders Svensson
In the case of retranmission, a prepare_retransmit callback could modify End-to-End and/or Hop-by-Hop identifiers so that the resulting diameter_request entry was not removed, since the removal was of entries with the identifiers of the original request. The chances someone doing this in practice are probably minimal.
2015-12-09Fix request table leak at exit signalAnders Svensson
The storing of request records in the ets table diameter_request was wrapped in a try/after so that the latter would unconditionally remove written entries. The problem is that it didn't deal with the process exiting as a result of an exit signal, since this doesn't raise in an exception. Since the process in question applies callbacks to user code, we can potentially be linked to other process and exit as a result. Trapping exits changes the current behaviour of the process, so spawn a monitoring process that cleans up upon reception of 'DOWN'.
2015-12-08Update appup for 18.2Anders Svensson
OTP-13137 request table leak No load order requirements (one file).
2015-10-09Update DiameterHans Bolinder
Record field types have been modified due to commit 8ce35b2: "Take out automatic insertion of 'undefined' from typed record fields".
2015-09-14Merge branch 'anders/diameter/18.1/OTP-12978' into maintAnders Svensson
* anders/diameter/18.1/OTP-12978: Update appup for 18.1
2015-09-14Merge branch 'anders/diameter/watchdog/OTP-12969' into maintAnders Svensson
* anders/diameter/watchdog/OTP-12969: Fix watchdog function_clause
2015-09-14Merge branch 'anders/diameter/M-bit/OTP-12947' into maintAnders Svensson
* anders/diameter/M-bit/OTP-12947: Add service_opt() strict_mbit
2015-09-10Update appup for 18.1Anders Svensson
OTP-12947 strict_mbit service_opt() OTP-12969 diameter_watchdog function_clause No load order requirements.
2015-09-07Fix watchdog function_clauseAnders Svensson
Commit 4f365c07 introduced the error on set_watchdog/2, as a consequence of timeout/1 returning stop, which only happens with accepting transports with {restrict_connections, false}.
2015-09-07Fix watchdog function_clauseAnders Svensson
Commit 4f365c07 introduced the error on set_watchdog/2, as a consequence of timeout/1 returning stop, which only happens with accepting transports with {restrict_connections, false}.
2015-08-25Add service_opt() strict_mbitAnders Svensson
There are differing opinions on whether or not reception of an arbitrary AVP setting the M-bit is an error. 1.3.4 of RFC 6733 says this about how an existing Diameter application may be modified: o The M-bit allows the sender to indicate to the receiver whether or not understanding the semantics of an AVP and its content is mandatory. If the M-bit is set by the sender and the receiver does not understand the AVP or the values carried within that AVP, then a failure is generated (see Section 7). It is the decision of the protocol designer when to develop a new Diameter application rather than extending Diameter in other ways. However, a new Diameter application MUST be created when one or more of the following criteria are met: M-bit Setting An AVP with the M-bit in the MUST column of the AVP flag table is added to an existing Command/Application. An AVP with the M-bit in the MAY column of the AVP flag table is added to an existing Command/Application. The point here is presumably interoperability: that the command grammar should specify explicitly what mandatory AVPs much be understood, and that anything more is an error. On the other hand, 3.2 says thus about command grammars: avp-name = avp-spec / "AVP" ; The string "AVP" stands for *any* arbitrary AVP ; Name, not otherwise listed in that Command Code ; definition. The inclusion of this string ; is recommended for all CCFs to allow for ; extensibility. This renders 1.3.4 pointless unless "*any* AVP" is qualified by "not setting the M-bit", since the sender can effectively violate 1.3.4 without this necessitating an error at the receiver. If clients add arbitrary AVPs setting the M-bit then request handling becomes more implementation-dependent. The current interpretation in diameter is strict: if a command grammar doesn't explicitly allow an AVP setting the M-bit then reception of such an AVP is regarded as an error. The strict_mbit option now allows this behaviour to be changed, false turning all responsibility for the M-bit over to the user.
2015-08-13Merge branch 'maint-17' into maintAnders Svensson
The diffs are all about adapting to the OTP 18 time interface. The code was previously backwards compatible, falling back on the erlang:now/0 if erlang:monotonic_time/0 is unavailable, but this was seen to be a bad thing in commit 9c0f2f2c. Use of erlang:now/0 is now removed.
2015-08-13Merge branch 'anders/diameter/17.5.6.3/OTP-12927' into maint-17Erlang/OTP
* anders/diameter/17.5.6.3/OTP-12927: vsn -> 1.9.2.1 Update appup for 17.5.6.3
2015-08-13Merge branch 'anders/diameter/17/time/OTP-12926' into maint-17Erlang/OTP
* anders/diameter/17/time/OTP-12926: Simplify time manipulation Remove use of monotonic time in pre-18 code Remove unnecessary redefinition of erlang:max/2
2015-08-13Merge branch 'anders/diameter/grouped_errors/OTP-12930' into maint-17Erlang/OTP
* anders/diameter/grouped_errors/OTP-12930: Fix decode of Grouped AVPs containing errors Simplify logic Simplify logic
2015-08-13Merge branch 'anders/diameter/transport/OTP-12929' into maint-17Erlang/OTP
* anders/diameter/transport/OTP-12929: Fix start order of alternate transports Log discarded answers
2015-08-13Merge branch 'anders/diameter/lcnt/OTP-12912' into maint-17Erlang/OTP
* anders/diameter/lcnt/OTP-12912: Make ets diameter_stats a set Remove unnecessary sorting in stats suite Set ets {write_concurrency, true} on diameter_stats Don't start watchdog timers unnecessarily Remove unnecessary erlang:monitor/2 qualification Add missing watchdog suite clause
2015-08-13Merge branch 'anders/diameter/caseless/OTP-12902' into maint-17Erlang/OTP
* anders/diameter/caseless/OTP-12902: Match allowable peer addresses case insensitively Replace calls to module inet_parse to equivalents in inet
2015-08-13Merge branch 'anders/diameter/grouped_decode/OTP-12879' into maint-17Erlang/OTP
* anders/diameter/grouped_decode/OTP-12879: Fix relay encode of decoded diameter_avp lists
2015-08-07Make ets diameter_stats a setAnders Svensson
There's no need for it to be ordered, and the ordering has been seen to have an unexpectedly negative impact on performance in some cases. Order when retrieving statistics instead, so as not to change the presentation in diameter:service_info/2.
2015-08-05Simplify time manipulationAnders Svensson
By doing away with more wrapping that the parent commit started to remove.
2015-08-05Remove use of monotonic time in pre-18 codeAnders Svensson
This has been seen to be a bottleneck at high load: each undef results in a loop out to the code server. Originally implemented as suggested in the erts user's guide, in commits e6d19a18 and d4386254.