File 0755-erts-Unlink-with-nc-checker-to-avoid-noconnect-signa.patch of Package erlang

From 9a02967c07b7f0b9c727111f1e3575a8f36b4ef1 Mon Sep 17 00:00:00 2001
From: Lukas Larsson <lukas@erlang.org>
Date: Fri, 26 Nov 2021 11:12:17 +0100
Subject: [PATCH 10/11] erts: Unlink with nc checker to avoid noconnect signal

There was a race in the shutdown where the node would
exit before the normal exit signal was sent which would
case the testcase to fail with a noconnection exit signal.
---
 erts/emulator/test/node_container_SUITE.erl | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/erts/emulator/test/node_container_SUITE.erl b/erts/emulator/test/node_container_SUITE.erl
index 161968fe0d..3f781170a4 100644
--- a/erts/emulator/test/node_container_SUITE.erl
+++ b/erts/emulator/test/node_container_SUITE.erl
@@ -1037,21 +1037,23 @@ nc_refc_check(Node) when is_atom(Node) ->
     Ref = make_ref(),
     Self = self(),
     io:format("Starting reference count check of node ~w~n", [Node]),
-    spawn_link(Node,
-               fun () ->
-                       erts_test_utils:check_node_dist(
-                         fun (ErrMsg) ->
-                                 Self ! {Ref, ErrMsg, failed},
-                                 exit(normal)
-                         end),
-                       Self ! {Ref, succeded}
-               end),
+    Pid = spawn_link(
+            Node,
+            fun () ->
+                    erts_test_utils:check_node_dist(
+                      fun (ErrMsg) ->
+                              Self ! {Ref, ErrMsg, failed},
+                              exit(normal)
+                      end),
+                    Self ! {Ref, succeded}
+            end),
     receive
         {Ref, ErrorMsg, failed} ->
             io:format("~s~n", [ErrorMsg]),
             ct:fail(reference_count_check_failed);
         {Ref, succeded} ->
             io:format("Reference count check of node ~w succeded!~n", [Node]),
+            unlink(Pid),
             ok
     end.
 
-- 
2.31.1

openSUSE Build Service is sponsored by