Examples using reliable-msg gem?

I’m wondering if anyone out there has written any code using the
reliable-msg gem.

It looks like a great system but I’m having a lot of trouble getting
it to work.

For example, I can’t get a Queue to successfully put/talk to a
QueueManager (essentially a DRb server) process unless it is running
within the same Ruby process. The documentation talks about running
the QueueManager in a separate process or even on a separate machine,
but every attempt at this fails. I’ve been digging through the code
but nothing obvious has jumped out at me.

I figure I need to be a DRb expert to understand it fully but I’m
using this gem because I don’t want to be a DRb expert.

So, has any kind soul out there been successful in writing any code
using reliable-msg? If so, would you be willing to share your
insights (if not your code)?

Thanks…

cr

I figured out the problem. In the queue-manager.rb file the author
sets up an ACL for the DRbServer. The acl contains “allow 127.0.0.1”.
For whatever reason, OSX binds to the port using IPv6 so the ACL
denies any connections coming through the loopback.

There are two fixes. One workaround is to eliminate the ACL.

The second workaround is to change the acl to read “allow 127.0.0.1,
allow ::1” where “::1” is the localhost equivalent for IPv6
(alternately, change 127.0.0.1 to localhost). After this change inter-
process calls work.

I hope the next person who runs into this problem finds this note. It
only took me 2 days to figure it out. :slight_smile:

cr

On Wed, 17 May 2006 [email protected] wrote:

I hope the next person who runs into this problem finds this note. It only
took me 2 days to figure it out. :slight_smile:

thank you for posting it!

-a

Quoting [email protected], on Wed, May 17, 2006 at 12:52:31PM
+0900:

process calls work.
Sounds like the code is assuming localhost is 127.0.0.1. This isn’t
true, its BOTH ::1 and 127.0.0.1. The code should probably be
consistent, either always use localhost, or always use IP addrs, but not
both. Or if it can actually use IPv6, maybe it should bind to all the
localhost addrs.

Of course, if you don’t have ipv6, there is only one IP addr that
localhost resolves to. Also, most people take the first addr when they
resolve a name, so if the first is usually ipv4, but sometimes (OS X,
for example) ipv6, you get strangeness.

I hope the next person who runs into this problem finds this note. It
only took me 2 days to figure it out. :slight_smile:

Ouch!

Once bitten, you know… ruby code that does gethostbyname() for
“localhost” and assumes the addr is ipv4 will not run on OS X (unless
the OS X box has IPv6 turned off).

Sam