Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kernel][dist_util] Support 4-arity #hs_data.f_handshake_complete in dist_util.erl #8473

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

potatosalad
Copy link
Contributor

@potatosalad potatosalad commented May 10, 2024

Currently, #hs_data.f_handshake_complete supports a 3-arity function with the following function signature:

fun (DistCtrlr, Node, DHandle) -> void()

This PR extends the callback to also handle a 4-arity function:

fun (DistCtrlr, Node, DHandle) -> void() |
fun (DistCtrlr, Node, DHandle, HsData) -> void()

Why? Once the handshake completes, there's currently no way to find out what the final ChosenFlags are between this_node and other_node; or what the value of other_creation was.

The HSData variable is effectively discarded entirely when con_loop is called, so this information is lost for those wanting to implement an alternative dist protocol.

See here for an example of how this information is used in WhatsApp/erldist_filter: https://github.com/WhatsApp/erldist_filter/blob/main/apps/erldist_filter/src/erldist_filter_otp_26_0_2_inet_tcp_dist.erl#L931-L937

…dist_util.erl

Currently, `#hs_data.f_handshake_complete` supports a 3-arity function with the following function signature:

```erlang
fun (DistCtrlr, Node, DHandle) -> void()
```

This PR extends the callback to also handle a 4-arity function:

```erlang
fun (DistCtrlr, Node, DHandle) -> void() |
fun (DistCtrlr, Node, DHandle, HsData) -> void()
```

Why?  Once the handshake compeltes, there's currently no way to find out what the final `ChosenFlags` are between `this_node` and `other_node`; or what the value of `other_creation` was.

The `HSData` variable is effectively discarded entirely when `con_loop` is called, so this information is lost for those wanting to implement an alternative dist protocol.

See here for an example of how this information is used in [WhatsApp/erldist_filter](https://github.com/WhatsApp/erldist_filter): https://github.com/WhatsApp/erldist_filter/blob/main/apps/erldist_filter/src/erldist_filter_otp_26_0_2_inet_tcp_dist.erl#L931-L937
Copy link
Contributor

github-actions bot commented May 10, 2024

CT Test Results

    4 files    199 suites   1h 47m 58s ⏱️
3 005 tests 2 715 ✅ 290 💤 0 ❌
3 952 runs  3 588 ✅ 364 💤 0 ❌

Results for commit ddd1c80.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@rickard-green rickard-green added the team:VM Assigned to OTP team VM label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:VM Assigned to OTP team VM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants