Skip to content

Commit 8de642a

Browse files
authored
Merge pull request #35 from rabbitmq/fix-lock-key
horus: Fix key used to lock concurrent accesses to the function cache
2 parents 8d80373 + 6b2045d commit 8de642a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/horus.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,8 @@ to_standalone_fun1(Fun, Options) ->
416416
to_standalone_fun2(Fun, State) ->
417417
case to_cached_standalone_fun(Fun, State) of
418418
undefined ->
419-
Lock = {{horus, Fun}, self()},
419+
Key = standalone_fun_cache_key(State),
420+
Lock = {Key, self()},
420421
global:set_lock(Lock, [node()]),
421422
try
422423
case to_cached_standalone_fun(Fun, State) of

0 commit comments

Comments
 (0)