aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter
AgeCommit message (Collapse)Author
2019-04-15Prepare releaseErlang/OTP
2019-04-14Add appup and code_changeAnders Svensson
For the parent commit as a diameter 2.2 patch.
2019-04-14Fix inadvertently broad monitorAnders Svensson
Commit d9d918b2 added a gen_server whose purpose is to keep track of visible nodes on which diameter_dist:attach/1 has been called to register a node as a handler of incoming Diameter requests when diameter_dist:route_session/2 is configured as spawn_opt MFA. The server contacts visible nodes at init in order to request information, but instead of monitoring visible to also be able to request information at nodeup, it monitored on all nodes, resulting in gen_server casts even to hidden nodes. Monitor only on visible nodes since a hidden node may not be able to deal with the new message.
2019-03-11Prepare releaseErlang/OTP
2019-03-08Merge branch 'anders/diameter/21.3/OTP-15654' into maintAnders Svensson
* anders/diameter/21.3/OTP-15654: Update appup for diameter 2.2 in OTP 21.3
2019-03-08Merge branch 'anders/diameter/distribution/OTP-15398' into maintAnders Svensson
* anders/diameter/distribution/OTP-15398: Add diameter_dist_SUITE to exercise diameter_dist:route_session/2 Add consistent hashing to diameter_dist:route_session/2 Add options to diameter_dist:route_session/2 node selection Add diameter_dist for ready spawn_opt callbacks Tweak/document request handler callback Document acknowledgements in transport interface Fix comment typo
2019-03-06Add diameter_dist_SUITE to exercise diameter_dist:route_session/2Anders Svensson
Spread a server over three nodes, one of which terminates a peer connection, the other two to handle requests. Terminate transport on one of the server nodes and ensure that answers come only from the other two.
2019-03-06Add consistent hashing to diameter_dist:route_session/2Anders Svensson
If the Session-Id optional value to node() mapping fails then hash Session-Id to a node by default, instead of selecting the local node as in the parent commit. The previous behaviour is configurable by setting default = local in an options map. Nodes make themselves part of the pool from which nodes are selected by calling diameter_dist:attach/1 with the list of service names they are willing to handle requests for, the local node being selected in the absence of any attached nodes. The original idea was to base the node pool on share_peers and/or use_shared_peers configuration, but that configuration determines where outgoing requests can be sent, while route_session/2 deals with incoming requests, so it's not obvious that conflating the two is a good thing. (Also because share_peers/use_shared_peers can be used in different ways; the former could have been skipped entirely.) The hashing effectively places nodes on a circle, a hashed Session-Id being mapped to the nearest predecessor node (clockwise). Nodes are rehashed with each Session-Id (with the id as salt) for a more even distribution, at the cost of performance, although how high the cost or how even the distribution has yet to be tested. Obviously, the larger the number of attached nodes, the higher the cost. Adding/removing an attached node only affects session ids that hash in the interval between the added/removed node and its successor (hence consistent hashing). Options are tweaked slightly compared to the parent commit, and it is now possible to restrict the optional value mapping to specific Diameter identities, to avoid mapping an id that was generated at the peer when the peer is also implemented with the diameter application. Note that diameter_dist is not yet an officially documented interface, so could change. Documentation is in the module itself.
2019-03-06Add options to diameter_dist:route_session/2 node selectionAnders Svensson
To be able to restrict how many AVPs will be examined (from the front of a message) when looking for Session-Id, and to decide what to do with if the AVP isn't found. Options are specified as a map of the following form. #{search => non_neg_integer(), default => discard | mfa(), dispatch => list() | mfa()} The search member says how many AVPs to examine at most, from the front of the message. If the optional value of a Session-Id is not the name of a connected node then the default member determines what to do with the request, handle it locally (the default), discard it, or invoke an MFA on the Session-Id | false (if none was found) and diameter_packet record to return a node() | false; if the latter then the request is discarded. If a node is identified then the dispatch MFA is invoked on the node and the request MFA (as three arguments), a list Opts being equivalent to the MFA {erlang, spawn_opt, [Opts]}, and the default being the empty list. Integer- or list-valued options are equivalent to the corresponding map with a single value. Limiting the search is to avoid searching messages containing many AVPs for a Session-Id that is known to occur near the header, since section 8.8 of RFC 6733 says this: When present, the Session-Id SHOULD appear immediately following the Diameter header (see Section 3). There's no guarantee, but in practice it may well be known that peers are respecting the RFC, and in that case limiting the search is a defense against searching messages from a malicious peer unnecessarily. The search is unlimited by default. A default is only used when a search fails to locate a Session-Id, and can be to discard the message, or have a node() or false be returned from an MFA applied to the diameter_packet in question. The local node is chosen by default.
2019-03-06Add diameter_dist for ready spawn_opt callbacksAnders Svensson
That is, of functions that can be configured as spawn_opt MFAs in transport configuration. This commits adds the spawn_local described in the parent commit, and a route_session that assumes that the local node initiates all sessions with Session-Id returned by diameter:session_id/1, and handles incoming requests on the node on which the id in question was returned, diameter:session_id/1 using node() as optional value in the Session-Id format.
2019-03-06Tweak/document request handler callbackAnders Svensson
The possibility of configuring an MFA as spawn_opt was added in commit fd285079, the callback being passed an arity-0 fun to be applied in an appropriate handler process. Replace the fun by a tuple to be passed to diameter_traffic:request/1, to avoid passing funs between nodes when handler processes are remote. A list-valued spawn_opt is now equivalent to the following configured as {spawn_opt, {Mod, spawn_local, [Opts]}}. spawn_local(ReqT, Opts) -> spawn_opt(diameter_traffic, request, [ReqT], Opts). ReqT is passed by diameter and contains information that the callback may want to decide where to handle the request in question (which wasn't accessible with a fun), but this information isn't exposed in a documented way. The intention is instead to add an own callback implementation to make use of the information. Note that application lookup now takes place in the watchdog process in both the list-valued (or no configuration) and mfa-valued cases. Whether this is good, bad, or (probably) inconsequential remains to be seen.
2019-03-06Document acknowledgements in transport interfaceAnders Svensson
This is the {diameter, ack} message from a transport process to its parent that requests that every Diameter request passed to the parent be matched by a incoming send message, the atom false replacing a message() in the case that the request is unanswered, allowing the transport to keep track of the number of outstanding requests. These were added in commit ca09cf7b, and are used to implement the message_cb config in diameter_tcp/sctp, documented in commit cefcaa5c. This commit documents the interface, to make it available to other transport implementations.
2019-03-06Update appup for diameter 2.2 in OTP 21.3Anders Svensson
2019-03-06Fix comment typoAnders Svensson
2019-02-22Merge branch 'ingela/diameter/ssl-dialyzer-types' into maintIngela Anderton Andin
* ingela/diameter/ssl-dialyzer-types: diameter: Update to use exported types
2019-02-14Merge branch 'maint-20' into maintAnders Svensson
* maint-20: Updated OTP version Prepare release
2019-02-14Prepare releaseErlang/OTP
2019-02-13Merge branch 'anders/diameter/nocatch/OTP-15569' into maintAnders Svensson
* anders/diameter/nocatch/OTP-15569: Update appup Fix nocatch on incoming answer with faulty Experimental-Result-Code
2019-02-12Update appupAnders Svensson
For OTP-15569, to be released in OTP 20.3.8.19.
2019-02-11diameter: Update to use exported typesIngela Anderton Andin
2019-02-08Fix nocatch on incoming answer with faulty Experimental-Result-CodeAnders Svensson
Failure to decode the Grouped AVP results in a throw from module diameter_gen, which is caught in the normal message decode, but wasn't when only the AVP is decoded from diameter_traffic (for error checking and counter increment). The result was no handle_answer/error callback, and an error return from diameter:call/4 when the detach option was not specified.
2018-12-11Add "since" attributes in xml for new functions and modulesSverker Eriksson
introduced after OTP_R13B03.
2018-09-24Prepare releaseErlang/OTP
2018-09-21Update copyright yearHenrik Nord
2018-09-12Merge branch 'anders/diameter/21.1/OTP-15202' into maintAnders Svensson
* anders/diameter/21.1/OTP-15202: vsn -> 2.1.6 Update appup for 21.1
2018-09-12Merge branch 'anders/diameter/dpr/OTP-15198' into maintAnders Svensson
* anders/diameter/dpr/OTP-15198: Fix function_clause when sending a request after an outgoing DPA
2018-09-10vsn -> 2.1.6Anders Svensson
2018-09-10Update appup for 21.1Anders Svensson
OTP-15198 Fix function_clause when sending a request after outgoing DPA
2018-07-18Fix function_clause when sending a request after an outgoing DPAAnders Svensson
After DPR, the intention is that outgoing answers are sent and outgoing requests are discarded. This was the case when the DPR was outgoing, but if it was incoming then a subsequent outgoing request resulted in a function_clause, bringing down the diameter_peer_fsm gen_server associated with the transport connection in question. With diameter_tcp/sctp, the failure can result in the connection being reset before the peer closes it in response to DPA, but is otherwise harmless since DPR means that the connection is already on its way down.
2018-07-13docs: make clean all XMLDIRLukas Larsson
2018-06-19Prepare releaseErlang/OTP
2018-06-18Update copyright yearHenrik Nord
2018-06-12Merge branch 'anders/diameter/21.0/OTP-15110'Anders Svensson
* anders/diameter/21.0/OTP-15110: Make diameter_app_SUITE fail more usefully Simplify app-file generation Match in diameter_app_SUITE to identify an unexpected path Don't use deprecated ssl:ssl_accept/1-3 Don't use deprecated erlang:get_stacktrace/0
2018-06-11Make diameter_app_SUITE fail more usefullyAnders Svensson
The badmatch in the grandparent commit is ssl not being installed: === Reason: no match of right hand side value {ssl,non_existing, ["non_existing"]} in function diameter_app_SUITE:app/1 (diameter_app_SUITE.erl, line 266) in call from diameter_app_SUITE:'-xref/1-fun-3-'/2 (diameter_app_SUITE.erl, line 214) in call from lists:'-filter/2-lc$^0/1-0-'/2 (lists.erl, line 1286) in call from diameter_app_SUITE:xref/1 (diameter_app_SUITE.erl, line 214) in call from test_server:ts_tc/3 (test_server.erl, line 1545) in call from test_server:run_test_case_eval1/6 (test_server.erl, line 1063) in call from test_server:run_test_case_eval/9 (test_server.erl, line 995) Tweak the failure a bit more, without fixing it.
2018-06-11Simplify app-file generationAnders Svensson
Don't bother generating applications/runtime_dependencies: what's lost in duplication is gained in clarity. SSL in runtime_applications but not applications in questionable, but it's been this way for a long time with no apparent ill effects or protests.
2018-06-11Match in diameter_app_SUITE to identify an unexpected pathAnders Svensson
See this failure in nightly test on one host, indicating that code:which/1 is returning something other than the expected path: === Ended at 2018-06-08 05:10:41 === Location: [{lists,nth,170}, {diameter_app_SUITE,app,265}, {diameter_app_SUITE,'-xref/1-fun-3-',214}, {lists,'-filter/2-lc$^0/1-0-',1286}, {diameter_app_SUITE,xref,214}, {test_server,ts_tc,1545}, {test_server,run_test_case_eval1,1063}, {test_server,run_test_case_eval,995}] === Reason: no function clause matching lists:nth(2,[]) (lists.erl, line 170) in function diameter_app_SUITE:app/1 (diameter_app_SUITE.erl, line 265) in call from diameter_app_SUITE:'-xref/1-fun-3-'/2 (diameter_app_SUITE.erl, line 214) in call from lists:'-filter/2-lc$^0/1-0-'/2 (lists.erl, line 1286) in call from diameter_app_SUITE:xref/1 (diameter_app_SUITE.erl, line 214) in call from test_server:ts_tc/3 (test_server.erl, line 1545) in call from test_server:run_test_case_eval1/6 (test_server.erl, line 1063) in call from test_server:run_test_case_eval/9 (test_server.erl, line 995)
2018-06-07Don't use deprecated ssl:ssl_accept/1-3Anders Svensson
2018-06-07Don't use deprecated erlang:get_stacktrace/0Anders Svensson
2018-05-29Revert "Prepare release"Henrik
This reverts commit fd8e49b5bddceaae803670121b603b5eee8c5c08.
2018-05-25Prepare releaseErlang/OTP
2018-05-02Revert "Update release notes"Henrik
This reverts commit 202bb737e3deabfebee683266f4b7c42781eb521.
2018-04-30Update release notesErlang/OTP
2018-04-26vsn -> 2.1.5Anders Svensson
2018-04-26Update appup for 21.0Anders Svensson
2018-04-26Fix release note typoAnders Svensson
For a documentation typo.
2018-04-26Fix documentation typosbitnitdit
2018-03-09Update release notesErlang/OTP
2018-03-06Merge branch 'anders/diameter/20.3/OTP-14946' into maintAnders Svensson
* anders/diameter/20.3/OTP-14946: vsn -> 2.1.4 Update appup for 20.3 Update service_info examples in doc Fix inaccurate comment
2018-03-05Merge branch 'anders/diameter/terminate/ERIERL-124' into maintAnders Svensson
* anders/diameter/terminate/ERIERL-124: Fix handling of SUSPECT connections at service termination
2018-03-05Merge branch 'anders/diameter/reg/OTP-14839' into maintAnders Svensson
* anders/diameter/reg/OTP-14839: Fix diameter_reg:subscribe/2 remove notification