Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
5745-pg-fix-pg-monitor_scope-0-1-return-value.p...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 5745-pg-fix-pg-monitor_scope-0-1-return-value.patch of Package erlang
From ef69cea0d7f71d8081f3c54ea1630776be01b5a0 Mon Sep 17 00:00:00 2001 From: Maxim Fedorov <maximfca@gmail.com> Date: Fri, 2 Sep 2022 13:47:07 -0700 Subject: [PATCH] [pg] fix pg:monitor_scope/0,1 return value These functions were expected to return the entire scope content, but due to a bug only local pids were returned. --- lib/kernel/src/pg.erl | 2 +- lib/kernel/test/pg_SUITE.erl | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/lib/kernel/src/pg.erl b/lib/kernel/src/pg.erl index a44794e352..017b1942b4 100644 --- a/lib/kernel/src/pg.erl +++ b/lib/kernel/src/pg.erl @@ -305,7 +305,7 @@ handle_call({leave_local, Group, PidOrPids}, _From, #state{scope = Scope, local handle_call(monitor, {Pid, _Tag}, #state{scope = Scope, scope_monitors = ScopeMon} = State) -> %% next line could also be done with iterating over process state, but it appears to be slower - Local = maps:from_list([{G,P} || [G,P] <- ets:match(Scope, {'$1', '_', '$2'})]), + Local = maps:from_list([{G,P} || [G,P] <- ets:match(Scope, {'$1', '$2', '_'})]), MRef = erlang:monitor(process, Pid), %% monitor the monitor, to discard it upon termination, and generate MRef {reply, {MRef, Local}, State#state{scope_monitors = ScopeMon#{MRef => Pid}}}; -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor