[Spread-users] Fixes and a question

David Robins dbrobins at student.math.uwaterloo.ca
Tue Jun 11 18:15:47 EDT 2002


I just installed Spread, and we're considering using it to do transaction
brokering; I ran into the following (minor) problems:

uname -a output:
SunOS crm 5.8 Generic_108528-10 sun4u sparc SUNW,Ultra-Enterprise-10000

cc -V output:
cc: Sun WorkShop 6 2000/04/07 C 5.1

1) makefile error
make -f SOLARIS_CC_makefile errored in creating the .to files:
cc -O -c -DARCH_SPARC_SOLARIS -D_REENTRANT user.c -o user.to
cc: illegal suffix of output filename
*** Error code 1
make: Fatal error: Command failed for target `user.to'

Solution: I changed the .c -> .to rule to the following:
%.to:   %.c
        $(CC) $(TCFLAGS) -D_REENTRANT $*.c -o $*.o
        mv $*.o $*.to

(Yes, it's stupid that a compiler cares about an extension.  But it does.)

2) perl documentation errors

perldoc Spread gives the connect call to be:

       # Connect
       my($mailbox, $private_group) = Spread::connect(
             spread_name => '4444 at host.domain.com',
             private_name => 'mrcool',
             );

In fact, Spread::connect requires not a hash (list) but a hash
_reference_, viz:

       # Connect
       my($mailbox, $private_group) = Spread::connect({ <-- added {}s
             spread_name => '4444 at host.domain.com',
             private_name => 'mrcool',
             });

I found the above problem in the list archive but the solution was bogus.
As it's quite typical to pass the args as a straight list (i.e. without
the {}) I'd be happy to test and post a patch to allow it; the simplest
method (and one that maintains backward compatibility, if there's
sufficient code written by people having figured out the correct method)
would be to just change sub connect in Spread.pm to:

sub connect {
  my($aa) = shift;
  $aa = { $aa, @_ } unless ref $aa;    <-- this is the addition
  $$aa{'private_name'} = $ENV{'USER'} unless defined($$aa{'private_name'});
  $$aa{'priority'} = 0 unless defined($$aa{'priority'});
  $$aa{'group_membership'} = 1 unless defined($$aa{'group_membership'});
  return connect_i($aa);
}

Also, $Spread::sperrno is incorrectly called $sperror.

3) Persistence?

It doesn't appear that Spread persists queued data, that is, if the
server were to die, the queued data is lost, it's not stored to a file or
a database.  Is this correct?  Are there any plans for such persistence?

Thanks,

Dave
Isa. 40:31






More information about the Spread-users mailing list