FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

strange strange strange problem... cluster.qos.Cluster

 
Post new topic   Reply to topic     Forum Index -> Mango
View previous topic :: View next topic  
Author Message
Paolo Invernizzi



Joined: 20 Jul 2006
Posts: 17

PostPosted: Thu Jul 20, 2006 6:55 am    Post subject: strange strange strange problem... cluster.qos.Cluster Reply with quote

I've a strange problem with mango (head) and DMD 0.163 (windows)

The name of the node, when loaded from cluster.properties, must be duped... if not, the HashMap (but also the standard D AA) reports the Node key (and the node name) as "cast_t"!

It's the second time that this bite me, char[].dup solved the problem. BUT, I cannot understand why... hints are welcome!

Before the patch...

Code:

10 INFO client.uno - cluster config: node = edoras
10 INFO client.uno - cluster config: multicast_port = 3333
11 INFO client.uno - cluster config: multicast_prefix = 225
11 INFO client.uno - cluster config: multicast_ttl = 1
11 INFO client.uno - creating bulletin consumer for channel 'cluster.server.advertise'
15 TRACE client.uno - discovering active cluster servers ...
18 ERROR client.uno - BulletinConsumer: Attempt to enable unknown cluster node 'edoras'


after the patch...
Code:

33 INFO client.uno - cluster config: node = edoras
33 INFO client.uno - cluster config: multicast_port = 3333
33 INFO client.uno - cluster config: multicast_prefix = 225
33 INFO client.uno - cluster config: multicast_ttl = 1
33 INFO client.uno - creating bulletin consumer for channel 'cluster.server.advertise'
37 TRACE client.uno - discovering active cluster servers ...
42 TRACE client.uno - enabling node 'edoras' on port 81




Index: Cluster.d
===================================================================
--- Cluster.d (revision 922)
+++ Cluster.d (working copy)
@@ -164,7 +164,7 @@
{
logger.info ("cluster config: "~name~" = "~value);
if (name == "node")
- nodeSet.addNode (new Node (logger, value));
+ nodeSet.addNode (new Node (logger, value.dup));
else
if (name == "multicast_port")
groupPort = cast(int) Integer.parse (value);


---
Paolo
Back to top
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Thu Jul 20, 2006 2:21 pm    Post subject: Reply with quote

I suspect you found a bug. Will update with your patch ... thx!

This happened because the content passed around is simply sliced from an input buffer (not allocated and copied). The 'value' slice would end up being reused for something else, thus a .dup is necessary. By default, most Mango modules avoid heap-activity where possible, so sometimes one has to be aware of that when stashing something away (like this instance).
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Mango All times are GMT - 6 Hours
Page 1 of 1

 
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


Powered by phpBB © 2001, 2005 phpBB Group