File 0238-ct-Fix-crash-in-ct_hooks_lock.patch of Package erlang
From d43ff28cf3b6cc1afa46027143cc6e33368dc008 Mon Sep 17 00:00:00 2001
From: Lukas Larsson <lukas@erlang.org>
Date: Wed, 5 Jan 2022 17:17:15 +0100
Subject: [PATCH 3/5] ct: Fix crash in ct_hooks_lock
If a process with a hook lock crashes when it is the
only process with a lock we should return to an unlocked
state and continue as normal.
---
lib/common_test/src/ct_hooks_lock.erl | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/common_test/src/ct_hooks_lock.erl b/lib/common_test/src/ct_hooks_lock.erl
index be50a33e01..16c95b9b46 100644
--- a/lib/common_test/src/ct_hooks_lock.erl
+++ b/lib/common_test/src/ct_hooks_lock.erl
@@ -109,7 +109,11 @@ handle_info({'DOWN',Ref,process,Pid,_},
gen_server:reply(NextFrom, locked),
NextRef = monitor(process, NextPid),
{noreply,State#state{ locked = {true, NextPid, NextRef},
- requests = Rest } }.
+ requests = Rest } };
+handle_info({'DOWN',Ref,process,Pid,_},
+ #state{ locked = {true, Pid, Ref},
+ requests = [] } = State) ->
+ {noreply, State#state{ locked = false } }.
terminate(_Reason, _State) ->
ok.
--
2.31.1