Implement fragmentation of large distribution messages #2133
This PR implements fragmentation of large Erlang Distribution signals in order to prevent head-of-line blocking. This PR introduces two changes to the
The new distribution headers look like this:
The following restrictions exist when using the message fragmentation:
In addition to these changes to the Erlang Distribution protocol, this PR also fixes and optimizes many internal issues.
NOTE: The documentation for the new distribution headers is not done yet.
The text was updated successfully, but these errors were encountered:
Before this change the inet driver was in list mode and thus the data from it had to be copied when received by the dist entry. This change puts the tcp port in binary mode and makes the any refc binary created by it be used all the way to the process where it is decoded. Thus eliminating one copy of the entire message payload.
The dist messages EXIT, EXIT2 and MONITOR_DOWN have been updated with new versions that send the reason term as part of the payload of the message instead of as part of the control message. This allows the decode of the reason to be done by the receiving process instead of the dist entry which in turn makes it possible for multiple decodes to be done in parallel. This change is done in order to make it easier to fragment the potentially large payload of EXIT, EXIT2 and MONITOR_DOWN into multiple distribution messages. OTP-15611
This commit removed the general send context (which was used very little anyways) and only uses the distributed send context. This will make it easier to use the dist API at the cost of a little bit more code for the local send.
The reason in EXIT and DOWN may be arbitrarily large, so we yield and allow other processes to execute while encoding and sending the signals over the distribution.