Erlang Mailing Lists

Author Message

<  Erlang  ~  strange behavior in pg2 module

ptmoy
Posted: Thu Mar 17, 2011 3:11 am Reply with quote
User Joined: 24 Dec 2009 Posts: 10 Location: New Jersey, U.S.A.
I tried the following:

* created a 2-node cluster (nodes a & b).
* call pg2:create(testgroup) from node b.
* call pg2:which_groups(testgroup) from node a.

Take a look at the node-a output. Erlang always returns [] on the first call to pg2:which_groups(). Subsequent calls return "testgroup" as expected. Can someone try this on their installation to see if he/she gets the same result? If yes, does anyone know why Erlang returns an empty list during the first call?


pm@T110:~$ erl -sname b
Erlang R14B01 (erts-5.8.2) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.8.2 (abort with ^G)
(b@T110)1> net_adm:ping(a@T110).
pong
(b@T110)2> pg2:create(testgroup).
ok
(b@T110)3>




pm@T110:~$ erl -sname a
Erlang R14B01 (erts-5.8.2) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.8.2 (abort with ^G)
(a@T110)1> pg2:which_groups().
[]
(a@T110)2> pg2:which_groups().
[testgroup]
(a@T110)3> pg2:which_groups().
[testgroup]
[/list]
View user's profile Send private message
Hans Bolinder
Posted: Mon Mar 21, 2011 9:58 am Reply with quote
User Joined: 05 Nov 2008 Posts: 24 Location: Stockholm
> If yes, does anyone know why Erlang returns an empty list
> during the first call?

You need to call pg2:start(). See pg2(3).

Best regards,

Hans Bolinder, Erlang/OTP team, Ericsson
View user's profile Send private message
ptmoy
Posted: Wed Mar 23, 2011 9:02 pm Reply with quote
User Joined: 24 Dec 2009 Posts: 10 Location: New Jersey, U.S.A.
Thanks Hans. That worked.

Documentation for pg2:start() says that: the server doesn't need to be started explicitly, so I was under the impression that when I call pg2:which_group(), Erlang would start the pg2 server automatically if it hadn't been started already. Maybe that's how it should work.
View user's profile Send private message
dongdongwu
Posted: Thu Sep 20, 2012 6:02 am Reply with quote
User Joined: 19 Sep 2012 Posts: 236
His good friend Diane said: "Christian Louboutin Men Shoes was a magician, he make shoes is immediately put his female people with legs and advantage. He understands women wanted to do and can make them into beautiful Cinderella." Madonna often in its concert wearing Christian louboutin high heels , and some famous superstar like Angelina jolie, mariah Carey, beyonce Knowles, the famous Japanese singer YaYouMei Hamasaki helps Christian Louboutin Men Shoes set up its powerful position. The youngest customers will count Tom cruise's daughter sully cruz. Louboutin made for only a pair of handmade Christian Louboutin high heel Shoes! Want to be more fashion? Put on Christian Louboutin Outlet !
Candy colors of the chalaza high-heeled shoes with lolita type allure, set full finely gem blue "neon shoes" is to need to use "sexy" to describe. Each pair are worth careful appreciation of lithe and graceful fairy ludaoli, what kind of most let you move?Christian Louboutin Men Shoes that one brush red is always cannot resist the temptation, Christian Louboutin men outlet continue to use the days of high 8cm above slender heel proclaim the sexy and luxuriant. The bowknot on black pointed high-heeled shoes with sharp rivet concomitant, wild python met enchanting color printing grain, It is that pairs of high-heeled shoes lets Carrie more feminine flavour. Like Christian Louboutin for men her word.
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum